diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000000..d4c5ce5d9d --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,39 @@ +# this build is designed to replicate the Travis CI workflow +name: Build with Maven + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + platform: [ ubuntu-latest ] + java-version: [ 8, 11, 17, 21, 24 ] + + runs-on: ${{ matrix.platform }} + env: + PLATFORM: ${{ matrix.platform }} + JAVA_VERSION: ${{ matrix.java-version }} + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + - name: Cache local Maven repository + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Build with Maven + run: mvn clean install --batch-mode --show-version --file pom.xml + diff --git a/.gitignore b/.gitignore index 5349d8455f..6d49341202 100644 --- a/.gitignore +++ b/.gitignore @@ -14,12 +14,6 @@ api/.classpath api/.project api/.settings/* api/target/* -api-1.9/.classpath -api-1.9/.project -api-1.9/.settings/* -api-2.0/.classpath -api-2.0/.project -api-2.0/.settings/* api-tests/.classpath api-tests/.project api-tests/.settings/* @@ -27,7 +21,6 @@ omod/.classpath omod/.project omod/.settings/* omod/target/* -test-1.9/target/* /.settings .DS_Store diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e9b981efd4..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: java -jdk: - - oraclejdk8 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..52f07dd23e --- /dev/null +++ b/LICENSE @@ -0,0 +1,401 @@ +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. + +--------------------- + +Healthcare Disclaimer + +In the United States, or any other jurisdictions where they may apply, the +following additional disclaimer of warranty and limitation of liability are +hereby incorporated into the terms and conditions of MPL 2.0: + +1. No warranties of any kind whatsoever are made as to the results that + You will obtain from relying upon the covered code (or any information + or content obtained by way of the covered code), including but not + limited to compliance with privacy laws or regulations or clinical + care industry standards and protocols. Use of the covered code is not + a substitute for a health care provider’s standard practice or + professional judgment. Any decision with regard to the appropriateness + of treatment, or the validity or reliability of information or content + made available by the covered code, is the sole responsibility of the + health care provider. Consequently, it is incumbent upon each health + care provider to verify all medical history and treatment plans with + each patient. + +2. Under no circumstances and under no legal theory, whether tort + (including negligence), contract, or otherwise, shall any Contributor, + or anyone who distributes Covered Software as permitted by the + license, be liable to You for any indirect, special, incidental, + consequential damages of any character including, without limitation, + damages for loss of goodwill, work stoppage, computer failure or + malfunction, or any and all other damages or losses, of any nature + whatsoever (direct or otherwise) on account of or associated with the + use or inability to use the covered content (including, without + limitation, the use of information or content made available by the + covered code, all documentation associated therewith, and the failure + of the covered code to comply with privacy laws and regulations or + clinical care industry standards and protocols), even if such party + shall have been informed of the possibility of such damages. + +Copyright (c) OpenMRS Inc. +OpenMRS is a registered trademark and the OpenMRS graphic logo is a trademark of OpenMRS Inc. \ No newline at end of file diff --git a/README.md b/README.md index abf4878952..41ec877938 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,15 @@ Requirements ================ OpenMRS 1.5.2 or higher -###Required Modules: +### Required Modules: 1. HTML Widgets 1.5.5 2. Serialization XStream 0.1.8.1 3. Calculation 1.2 -###Recommended modules: +### Recommended modules: 1. Reporting Compatibility 1.5.0.3 -View, download or fork source code: on GitHub +View, download or fork source code on GitHub Installation @@ -41,9 +41,9 @@ Upgrade To upgrade from Reporting Module 0.3.x: 1. Check to make sure that you have all of the Required Modules installed on your system. 2. Log into OpenMRS - 3. Navigate to Admin > Manage Modules. + 3. Navigate to `Admin` > `Manage Modules`. 4. Click the trash icon next to Reporting 0.3.x to remove the module from your system. - 5. Navigate to the newer omod on your system using the browse button and click Upload. + 5. Navigate to the newer omod on your system using the browse button and click `Upload`. Privileges diff --git a/api-1.9/.gitignore b/api-1.9/.gitignore deleted file mode 100644 index b83d22266a..0000000000 --- a/api-1.9/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/api-1.9/pom.xml b/api-1.9/pom.xml deleted file mode 100644 index 804bb0a447..0000000000 --- a/api-1.9/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - - - org.openmrs.module - reporting - 1.16.0-SNAPSHOT - - - reporting-api-1.9 - jar - reporting Module api 1.9 - 1.9 api project for reporting - - - 1.9.9 - - - - - ${project.parent.groupId} - ${project.parent.artifactId}-api - ${project.parent.version} - provided - - - - org.openmrs.api - openmrs-api - ${openMRSVersion} - provided - - - - org.openmrs.api - openmrs-api - test-jar - ${openMRSVersion} - test - - - - org.openmrs.test - openmrs-test - ${openMRSVersion} - pom - test - - - - - - - - src/main/resources - true - - - - - - src/test/resources - - **/*.properties - **/*.xml - - true - - - src/test/resources - - **/*.properties - **/*.xml - - false - - - - - diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/DataExportDataSetDefinition.java b/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/DataExportDataSetDefinition.java deleted file mode 100644 index 3d097f7fb8..0000000000 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/DataExportDataSetDefinition.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.dataset.definition; - -import org.openmrs.BaseOpenmrsMetadata; -import org.openmrs.BaseOpenmrsObject; -import org.openmrs.module.reporting.common.Localized; -import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; -import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy; -import org.openmrs.module.reporting.evaluation.caching.Caching; -import org.openmrs.reporting.export.DataExportReportObject; - -/** - * Definition of a dataset that runs a Data Export (of the sort created in the reportingcompatibility - * module. - * @see DataExportDataSetDefinition - */ -@Caching(strategy=ConfigurationPropertyCachingStrategy.class) -@SuppressWarnings("deprecation") -@Localized("reporting.DataExportDataSetDefinition") -public class DataExportDataSetDefinition extends BaseDataSetDefinition { - - public static final long serialVersionUID = -2572061676651616176L; - - //***** PROPERTIES ***** - - @ConfigurationProperty - private DataExportReportObject dataExport; - - //***** CONSTRUCTORS ***** - - /** - * Default public constructor - */ - public DataExportDataSetDefinition() { - super(); - } - - /** - * Full constructor - */ - public DataExportDataSetDefinition(DataExportReportObject dataExport) { - this.dataExport = dataExport; - } - - //***** INSTANCE METHODS ***** - - /** - * @see BaseDataSetDefinition#getId() - */ - @Override - public Integer getId() { - return (getDataExport() == null ? null : getDataExport().getId()); - } - - /** - * @see BaseOpenmrsObject#getUuid() - */ - @Override - public String getUuid() { - return (getDataExport() == null ? null : getDataExport().getUuid()); - } - - /** - * @see BaseOpenmrsMetadata#getName() - */ - @Override - public String getName() { - return (getDataExport() == null ? null : getDataExport().getName()); - } - - /** - * @see BaseOpenmrsMetadata#getDescription() - */ - @Override - public String getDescription() { - return (getDataExport() == null ? null : getDataExport().getDescription()); - } - - //***** PROPERTY ACCESS ***** - - /** - * @return the dataExport - */ - public DataExportReportObject getDataExport() { - return dataExport; - } - - /** - * @param dataExport the dataExport to set - */ - public void setDataExport(DataExportReportObject dataExport) { - this.dataExport = dataExport; - } -} diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataExportDataSetEvaluator.java b/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataExportDataSetEvaluator.java deleted file mode 100644 index 2e26138e8e..0000000000 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataExportDataSetEvaluator.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.dataset.definition.evaluator; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.openmrs.annotation.Handler; -import org.openmrs.module.reporting.common.ObjectUtil; -import org.openmrs.module.reporting.dataset.DataSet; -import org.openmrs.module.reporting.dataset.DataSetColumn; -import org.openmrs.module.reporting.dataset.DataSetRow; -import org.openmrs.module.reporting.dataset.SimpleDataSet; -import org.openmrs.module.reporting.dataset.definition.DataExportDataSetDefinition; -import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; -import org.openmrs.module.reporting.evaluation.EvaluationContext; -import org.openmrs.reporting.export.DataExportReportObject; -import org.openmrs.reporting.export.DataExportUtil; -import org.openmrs.util.OpenmrsUtil; - -/** - * The logic that evaluates a {@link DataExportDataSetDefinition} and produces a {@link DataSet} - * @see DataExportDataSetDefinition - * @see DataSet - */ -@Handler(supports={DataExportDataSetDefinition.class}) -@SuppressWarnings("deprecation") -public class DataExportDataSetEvaluator implements DataSetEvaluator { - - private Log log = LogFactory.getLog(this.getClass()); - - /** - * Public constructor - */ - public DataExportDataSetEvaluator() {} - - /** - * @see DataSetEvaluator#evaluate(DataSetDefinition, EvaluationContext) - * @should evaluate a DataExportDataSetDefinition - */ - public DataSet evaluate(DataSetDefinition definition, EvaluationContext context) { - - context = ObjectUtil.nvl(context, new EvaluationContext()); - SimpleDataSet dataSet = new SimpleDataSet(definition, context); - try { - DataExportDataSetDefinition dataExportDefinition = (DataExportDataSetDefinition) definition; - DataExportReportObject dataExport = dataExportDefinition.getDataExport(); - DataExportUtil.generateExport(dataExport, context.getBaseCohort(), null); - - File dataFile = DataExportUtil.getGeneratedFile(dataExportDefinition.getDataExport()); - - // Get contents as a string - // TODO Test whether this is faster than another approach - String contents = OpenmrsUtil.getFileAsString(dataFile); - String [] rows = contents.split("\\n"); - - // Get column names - String [] columns = rows[0].split("\\t"); - Map cols = new HashMap(); - for (String s : columns) { - DataSetColumn c = new DataSetColumn(s, s, String.class); - cols.put(s, c); - dataSet.getMetaData().addColumn(c); - } - - // Iterate over remaining rows - for (int i=1; i getAllDefinitions(boolean includeRetired) { - List dataSetDefinitions = new Vector(); - if (ModuleFactory.getStartedModulesMap().containsKey("reportingcompatibility") && - ReportingConstants.GLOBAL_PROPERTY_INCLUDE_DATA_EXPORTS()) { - ReportObjectService ros = Context.getService(ReportObjectService.class); - List dataExports = ros.getReportObjectsByType("Data Export"); - - for (AbstractReportObject obj : dataExports) { - DataExportReportObject dataExport = (DataExportReportObject) obj; - dataExport.setUuid(obj.getUuid()); // hack to get uuids into data exports - dataSetDefinitions.add(new DataExportDataSetDefinition(dataExport)); - } - } - return dataSetDefinitions; - } - - /** - * @see DataSetDefinitionPersister#getNumberOfDefinitions(boolean) - */ - public int getNumberOfDefinitions(boolean includeRetired) { - if (ModuleFactory.getStartedModulesMap().containsKey("reportingcompatibility")) { - ReportObjectService ros = Context.getService(ReportObjectService.class); - List dataExports = ros.getReportObjectsByType("Data Export"); - return dataExports.size(); - } - return 0; - } - - /** - * @see DataSetDefinitionPersister#getDefinitions(String, boolean) - */ - public List getDefinitions(String name, boolean exactMatchOnly) { - List ret = new ArrayList(); - for(DataSetDefinition dsd : getAllDefinitions(false)) { - if (dsd.getName() != null) { - if (exactMatchOnly) { - if (dsd.getName().equalsIgnoreCase(name)) { - ret.add(dsd); - } - } - else { - if (dsd.getName().toUpperCase().contains(name.toUpperCase())) { - ret.add(dsd); - } - } - } - } - return ret; - } - - /** - * @see DataSetDefinitionPersister#saveDefinition(DataSetDefinition) - */ - public DataSetDefinition saveDefinition(DataSetDefinition dataSetDefinition) { - DataExportDataSetDefinition dsd = (DataExportDataSetDefinition) dataSetDefinition; - ReportObjectService ros = Context.getService(ReportObjectService.class); - DataExportReportObject dataExport = (DataExportReportObject) ros.saveReportObject(dsd.getDataExport()); - dsd.setDataExport(dataExport); - return dsd; - } - - /** - * @see DataSetDefinitionPersister#purgeDefinition(DataSetDefinition) - */ - public void purgeDefinition(DataSetDefinition dataSetDefinition) { - DataExportDataSetDefinition dsd = (DataExportDataSetDefinition) dataSetDefinition; - Context.getService(ReportObjectService.class).purgeReportObject(dsd.getDataExport()); - } -} diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java b/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java deleted file mode 100644 index 4f88657f45..0000000000 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java +++ /dev/null @@ -1,213 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.apache.commons.lang.StringUtils; -import org.hibernate.Hibernate; -import org.hibernate.HibernateException; -import org.hibernate.engine.SessionImplementor; -import org.hibernate.type.Type; -import org.hibernate.usertype.CompositeUserType; -import org.hibernate.usertype.ParameterizedType; -import org.hibernate.usertype.UserType; -import org.openmrs.api.context.Context; -import org.openmrs.module.reporting.common.HibernateUtil; -import org.openmrs.module.reporting.definition.DefinitionContext; -import org.openmrs.module.reporting.evaluation.Definition; -import org.openmrs.module.reporting.evaluation.parameter.Mapped; -import org.openmrs.module.reporting.evaluation.parameter.Parameterizable; -import org.openmrs.module.reporting.serializer.ReportingSerializer; - -/** - * Custom User-Type for storing Mapped objects in a single table within 2 columns - * This type takes in 2 properties and 1 parameter in the form: - *
- *		
- *			
- *			
- *			
- *				org.openmrs.module.reporting.report.definition.ReportDefinition
- *			
- *		
- * 
- */ -@SuppressWarnings({"rawtypes", "unchecked"}) -public class MappedDefinitionType implements CompositeUserType, ParameterizedType { - - /** - * Property via ParameterizedType for storing the type of the Mapped Parameterizable - */ - private Class mappedType; - - /** - * @see CompositeUserType#returnedClass() - */ - public Class returnedClass() { - return Mapped.class; - } - - /** - * @see CompositeUserType#getPropertyNames() - */ - public String[] getPropertyNames() { - return new String[] {"definition", "parameterMappings"}; - } - - /** - * @see CompositeUserType#getPropertyTypes() - */ - public Type[] getPropertyTypes() { - return new Type[] { HibernateUtil.standardType("STRING"), HibernateUtil.standardType("TEXT") }; - } - - /** - * @see CompositeUserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see CompositeUserType#getPropertyValue(java.lang.Object, int) - */ - public Object getPropertyValue(Object component, int property) throws HibernateException { - Mapped m = (Mapped) component; - return (property == 0 ? m.getParameterizable() : m.getParameterMappings()); - } - - /** - * @see CompositeUserType#setPropertyValue(java.lang.Object, int, java.lang.Object) - */ - public void setPropertyValue(Object component, int property, Object value) throws HibernateException { - Mapped m = (Mapped) component; - if (property == 0) { - m.setParameterizable((Parameterizable)value); - } - else { - m.setParameterMappings((Map)value); - } - } - - /** - * @see CompositeUserType#deepCopy(java.lang.Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value == null) return null; - Mapped toCopy = (Mapped) value; - Mapped m = new Mapped(); - m.setParameterizable(toCopy.getParameterizable()); - m.setParameterMappings(new HashMap(toCopy.getParameterMappings())); - return m; - } - - /** - * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - String parameterizableUuid = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[0], session, owner); - if (StringUtils.isEmpty(parameterizableUuid)) { return null; } - String serializedMappings = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); - Definition d = DefinitionContext.getDefinitionByUuid(mappedType, parameterizableUuid); - Map mappings = new HashMap(); - if (StringUtils.isNotBlank(serializedMappings)) { - try { - mappings = Context.getSerializationService().deserialize(serializedMappings, Map.class, ReportingSerializer.class); - } - catch (Exception e) { - throw new HibernateException("Unable to deserialize parameter mappings for definition", e); - } - } - return new Mapped(d, mappings); - } - - /** - * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - String definitionUuid = null; - String serializedMappings = null; - if (value != null) { - Mapped m = (Mapped) value; - if (m.getParameterizable() != null) { - definitionUuid = m.getParameterizable().getUuid(); - if (m.getParameterMappings() != null && !m.getParameterMappings().isEmpty()) { - try { - serializedMappings = Context.getSerializationService().serialize(m.getParameterMappings(), ReportingSerializer.class); - } - catch (Exception e) { - throw new HibernateException("Unable to serialize mappings for definition", e); - } - } - } - } - HibernateUtil.standardType("STRING").nullSafeSet(st, definitionUuid, index, session); - HibernateUtil.standardType("STRING").nullSafeSet(st, serializedMappings, index+1, session); - } - - /** - * @see CompositeUserType#replace(Object, Object, SessionImplementor, Object) - */ - public Object replace(Object original, Object target, SessionImplementor session, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see CompositeUserType#disassemble(Object, SessionImplementor) - */ - public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException { - return (Serializable) deepCopy(value); - } - - /** - * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) - */ - public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException { - return deepCopy(cached); - } - - /** - * @see ParameterizedType#setParameterValues(Properties) - */ - public void setParameterValues(Properties parameters) { - String mappedTypeStr = parameters.getProperty("mappedType"); - try { - mappedType = (Class)Context.loadClass(mappedTypeStr); - } - catch (Exception e) { - throw new HibernateException("Error setting the mappedType property to " + mappedTypeStr, e); - } - } -} \ No newline at end of file diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java b/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java deleted file mode 100644 index b9f3f3eb66..0000000000 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.hibernate.HibernateException; -import org.hibernate.engine.SessionImplementor; -import org.hibernate.type.Type; -import org.hibernate.usertype.CompositeUserType; -import org.hibernate.usertype.UserType; -import org.openmrs.module.reporting.common.HibernateUtil; -import org.openmrs.module.reporting.report.renderer.RenderingMode; -import org.openmrs.module.reporting.report.renderer.ReportRenderer; - -/** - * Custom User-Type for storing RenderingModes in a single table within 2 columns - * This type takes in 2 properties in the form: - *
- *   
- *     
- *     
- *   
- * 
- */ -@SuppressWarnings({"rawtypes"}) -public class RenderingModeType implements CompositeUserType { - - /** - * @see CompositeUserType#returnedClass() - */ - public Class returnedClass() { - return RenderingMode.class; - } - - /** - * @see CompositeUserType#getPropertyNames() - */ - public String[] getPropertyNames() { - return new String[] {"renderer", "argument"}; - } - - /** - * @see CompositeUserType#getPropertyTypes() - */ - public Type[] getPropertyTypes() { - return new Type[] { HibernateUtil.standardType("CLASS"), HibernateUtil.standardType("STRING") }; - } - - /** - * @see CompositeUserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see CompositeUserType#getPropertyValue(java.lang.Object, int) - */ - public Object getPropertyValue(Object component, int property) throws HibernateException { - RenderingMode m = (RenderingMode) component; - return (property == 0 ? m.getRenderer().getClass() : m.getArgument()); - } - - /** - * @see CompositeUserType#setPropertyValue(java.lang.Object, int, java.lang.Object) - */ - public void setPropertyValue(Object component, int property, Object value) throws HibernateException { - RenderingMode m = (RenderingMode) component; - if (property == 0) { - ReportRenderer r = null; - if (value != null) { - try { - r = (ReportRenderer)((Class) value).newInstance(); - } - catch (Exception e) { - throw new HibernateException("Error instantiating a new reporting renderer from " + value, e); - } - } - m.setRenderer(r); - } - else { - m.setArgument((String)value); - } - } - - /** - * @see CompositeUserType#deepCopy(java.lang.Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value == null) return null; - RenderingMode toCopy = (RenderingMode) value; - return new RenderingMode(toCopy.getRenderer(), toCopy.getLabel(), toCopy.getArgument(), toCopy.getSortWeight()); - } - - /** - * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - Class rendererClass = (Class) HibernateUtil.standardType("CLASS").nullSafeGet(rs, names[0], session, owner); - if (rendererClass == null) { return null; } - String argument = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); - ReportRenderer r = null; - try { - r = (ReportRenderer)((Class) rendererClass).newInstance(); - } - catch (Exception e) { - throw new HibernateException("Error instantiating a new reporting renderer from " + rendererClass, e); - } - return new RenderingMode(r, r.getClass().getSimpleName(), argument, null); - } - - /** - * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - RenderingMode mode = (RenderingMode) value; - HibernateUtil.standardType("CLASS").nullSafeSet(st, mode == null ? null : mode.getRenderer().getClass(), index, session); - HibernateUtil.standardType("STRING").nullSafeSet(st, mode == null ? null : mode.getArgument(), index+1, session); - } - - /** - * @see CompositeUserType#replace(java.lang.Object, java.lang.Object, org.hibernate.engine.SessionImplementor, java.lang.Object) - */ - public Object replace(Object original, Object target, SessionImplementor session, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see CompositeUserType#disassemble(Object, SessionImplementor) - */ - public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException { - return (Serializable) deepCopy(value); - } - - /** - * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) - */ - public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException { - return deepCopy(cached); - } -} \ No newline at end of file diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java b/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java deleted file mode 100644 index 16876a0e39..0000000000 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Types; - -import org.hibernate.HibernateException; -import org.hibernate.usertype.UserType; -import org.openmrs.api.context.Context; -import org.openmrs.module.reporting.report.definition.ReportDefinition; -import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; - -/** - * A report definition type - */ -public class ReportDefinitionType implements UserType { - - /** - * @see UserType#assemble(Serializable, Object) - */ - public Object assemble(Serializable cached, Object owner) throws HibernateException { - if(cached == null){ - return null; - } - return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(cached.toString()); - } - - /** - * @see UserType#deepCopy(Object) - */ - public Object deepCopy(Object value) throws HibernateException { - return value; - } - - /** - * @see UserType#disassemble(Object) - */ - public Serializable disassemble(Object value) throws HibernateException { - if (value == null) { - return null; - } - return ((ReportDefinition)value).getUuid(); - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see UserType#isMutable() - */ - public boolean isMutable() { - return false; - } - - /** - * @see UserType#nullSafeGet(ResultSet, String[], Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { - String uuid = rs.getString(names[0]); - if (uuid == null) { - return null; - } - return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(uuid); - } - - /** - * @see UserType#nullSafeSet(PreparedStatement, Object, int) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { - ReportDefinition d = (ReportDefinition) value; - String val = (d == null ? null : d.getUuid()); - st.setString(index, val); - } - - /** - * @see UserType#replace(Object, Object, Object) - */ - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#returnedClass() - */ - @SuppressWarnings("rawtypes") - public Class returnedClass() { - return ReportDefinition.class; - } - - /** - * @see UserType#sqlTypes() - */ - public int[] sqlTypes() { - return new int[] { Types.VARCHAR }; - } -} diff --git a/api-1.9/src/test/java/org/openmrs/module/reporting/dataset/DataExportDataSetPersisterTest.java b/api-1.9/src/test/java/org/openmrs/module/reporting/dataset/DataExportDataSetPersisterTest.java deleted file mode 100644 index b00f350538..0000000000 --- a/api-1.9/src/test/java/org/openmrs/module/reporting/dataset/DataExportDataSetPersisterTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public License, - * v. 2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under - * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. - * - * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS - * graphic logo is a trademark of OpenMRS Inc. - */ -package org.openmrs.module.reporting.dataset; - -import java.util.List; - -import org.junit.Assert; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.openmrs.api.context.Context; -import org.openmrs.module.reporting.dataset.definition.DataExportDataSetDefinition; -import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; -import org.openmrs.module.reporting.dataset.definition.persister.DataExportDataSetDefinitionPersister; -import org.openmrs.module.reporting.dataset.definition.persister.DataSetDefinitionPersister; -import org.openmrs.reporting.ReportObjectService; -import org.openmrs.reporting.export.DataExportReportObject; -import org.openmrs.test.BaseModuleContextSensitiveTest; -import org.openmrs.test.StartModule; - -/** - * Test of the Data Export Data Set Persister - */ -@SuppressWarnings("deprecation") -@StartModule( { "org/openmrs/module/reporting/include/reportingcompatibility-1.5.3.omod" }) -@Ignore -public class DataExportDataSetPersisterTest extends BaseModuleContextSensitiveTest { - - protected static Log log = LogFactory.getLog(DataExportDataSetPersisterTest.class); - - @Before - public void setupInitialData() throws Exception { - { - DataExportReportObject ro = new DataExportReportObject(); - ro.setName("Test Last Weight"); - ro.setDescription("Description 1"); - ro.addSimpleColumn("patientId", "patientId"); - ro.addConceptColumn("weight", "LAST", 1, "5089", null); - Context.getReportObjectService().saveReportObject(ro); - } - { - DataExportReportObject ro = new DataExportReportObject(); - ro.setName("Test CD4"); - ro.setDescription("Description 2"); - ro.addSimpleColumn("patientId", "patientId"); - ro.addConceptColumn("cd4", "LAST", 1, "5497", null); - Context.getReportObjectService().saveReportObject(ro); - } - { - DataExportReportObject ro = new DataExportReportObject(); - ro.setName("Test Name"); - ro.setDescription("Description 3"); - ro.addSimpleColumn("patientId", "patientId"); - ro.addSimpleColumn("name", "personName"); - Context.getReportObjectService().saveReportObject(ro); - } - { - DataExportReportObject ro = new DataExportReportObject(); - ro.setName("Test First 3 Weights"); - ro.setDescription("Description 4"); - ro.addSimpleColumn("patientId", "patientId"); - ro.addConceptColumn("weight", "FIRST", 3, "5089", null); - Context.getReportObjectService().saveReportObject(ro); - } - { - DataExportReportObject ro = new DataExportReportObject(); - ro.setName("Test Gender"); - ro.setDescription("Description 5"); - ro.addSimpleColumn("patientId", "patientId"); - ro.addSimpleColumn("gender", "patient.gender"); - Context.getReportObjectService().saveReportObject(ro); - } - } - - @Test - public void shouldReturnDataSetDefinitionIfExists() throws Exception { - // big time hack: this test only works if it's first, because I'm creating the Data Exports programmatically, and each run they get new autonumbered ids. - // if the initial data gets set up via executing an xml dataset instead, then this test can be anywhere in the class - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - DataSetDefinition def = persister.getDefinition(1); - Assert.assertNotNull("Should return dataset definition if exists", def); - } - - /** - * Tests whether the persister returns all dataset definitions. - * - * @throws Exception - */ - @Test - public void shouldGetAllDataSetDefinitions() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - List list = persister.getAllDefinitions(false); - Assert.assertEquals("Should return all dataset definitions", 5, list.size()); - } - - @Test - public void shouldReturnAllDatasetDefinitionsIncludingRetired() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - List list = persister.getAllDefinitions(true); - Assert.assertEquals("Should return all dataset definitions, including retired", 5, list.size()); - } - - @Test - public void shouldReturnAllDatasetDefinitionsExcludingRetired() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - List list = persister.getAllDefinitions(false); - Assert.assertEquals("Should return all dataset definitions, excluding retired", 5, list.size()); - } - - @Test - public void shouldReturnNullIfNotExist() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - DataSetDefinition def = persister.getDefinition(999); - Assert.assertNull("Should return null if not exists", def); - } - @Test - public void shouldReturnNullIfNameDoesNotMatch() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - List def = - persister.getDefinitions("Dataset definition that does not exist", true); - Assert.assertEquals(0, def.size()); - } - - @Test - public void shouldReturnDataSetDefinitionIfNameMatches() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - List def = - persister.getDefinitions("Test First 3 Weights", true); - Assert.assertEquals(1, def.size()); - } - - @Test(expected=UnsupportedOperationException.class) - public void shouldNotBeAbleToModifyUnderlyingDataExport() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - DataSetDefinition datasetDefinition = persister.getDefinitions("Test First 3 Weights", true).get(0); - datasetDefinition.setName("My Data Set Definition"); - } - - @Test - public void shouldSetIdentifierAfterSave() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - DataExportReportObject dataExport = (DataExportReportObject) Context.getService(ReportObjectService.class).getReportObject(45); - dataExport.setReportObjectId(null); - dataExport.setName("My Data Set Definition"); - // Save an existing data set definition - DataSetDefinition datasetDefinition = new DataExportDataSetDefinition(dataExport); - datasetDefinition = persister.saveDefinition(datasetDefinition); - Assert.assertNotNull("Should set identifier after saving dataset definition", datasetDefinition.getId()); - } - - @Test - public void shouldRemoveDataSetDefintion() throws Exception { - DataSetDefinitionPersister persister = new DataExportDataSetDefinitionPersister(); - DataSetDefinition beforePurge = persister.getDefinitions("Test First 3 Weights", true).get(0); - int idBefore = beforePurge.getId(); - persister.purgeDefinition(beforePurge); - DataSetDefinition afterPurge = persister.getDefinition(idBefore); - Assert.assertNull(afterPurge); - } -} diff --git a/api-2.0/.gitignore b/api-2.0/.gitignore deleted file mode 100644 index b83d22266a..0000000000 --- a/api-2.0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/api-2.0/pom.xml b/api-2.0/pom.xml deleted file mode 100644 index a1366d0fe8..0000000000 --- a/api-2.0/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - - - org.openmrs.module - reporting - 1.16.0-SNAPSHOT - - - reporting-api-2.0 - jar - reporting Module api 2.0 - 2.0 api project for reporting - - - 2.0.0-alpha - - - - - ${project.parent.groupId} - ${project.parent.artifactId}-api - ${project.parent.version} - provided - - - - org.openmrs.api - openmrs-api - ${openMRSVersion} - provided - - - - org.openmrs.api - openmrs-api - test-jar - ${openMRSVersion} - test - - - - org.openmrs.test - openmrs-test - ${openMRSVersion} - pom - test - - - - - - - - src/main/resources - true - - - - - - src/test/resources - - **/*.properties - **/*.xml - - true - - - src/test/resources - - **/*.properties - **/*.xml - - false - - - - - diff --git a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java b/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java deleted file mode 100644 index bd8979fab6..0000000000 --- a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import static java.sql.Types.VARCHAR; - -import java.io.IOException; -import java.io.Serializable; -import java.io.StringReader; -import java.io.StringWriter; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Map; -import java.util.Properties; - -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.usertype.UserType; - -/** - * A report definition type - */ -public class PropertiesType implements UserType { - - /** - * @see UserType#assemble(Serializable, Object) - */ - public Object assemble(Serializable cached, Object owner) throws HibernateException { - if (cached == null) { - return null; - } - try { - String s = (String) cached; - Properties p = new Properties(); - p.load(new StringReader(s)); - return p; - } - catch (IOException e) { - throw new IllegalArgumentException("Unable to load properties from string", e); - } - } - - /** - * @see UserType#deepCopy(Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value != null) { - Properties val = (Properties) value; - Properties copy = new Properties(); - for ( Map.Entry e : val.entrySet() ) { - copy.setProperty((String) e.getKey(), (String) e.getValue()); - } - return copy; - } else { - return null; - } - } - - /** - * @see UserType#disassemble(Object) - */ - public Serializable disassemble(Object value) throws HibernateException { - if (value == null) { - return null; - } - try { - Properties props = (Properties) value; - StringWriter sw = new StringWriter(); - props.store(sw, null); - return sw.toString(); - } - catch (IOException e) { - throw new IllegalArgumentException("Unable to store properties as string", e); - } - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see UserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see UserType#nullSafeGet(ResultSet, String[], Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - String s = rs.getString(names[0]); - return assemble(s, null); - } - - /** - * @see UserType#nullSafeSet(PreparedStatement, Object, int) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - String val = (String) disassemble(value); - st.setString(index, val); - } - - /** - * @see UserType#replace(Object, Object, Object) - */ - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#returnedClass() - */ - @SuppressWarnings("unchecked") - public Class returnedClass() { - return Properties.class; - } - - /** - * @see UserType#sqlTypes() - */ - public int[] sqlTypes() { - return new int[] { VARCHAR }; - } -} diff --git a/api-tests/females.groovy b/api-tests/females.groovy deleted file mode 100644 index 301adda98f..0000000000 --- a/api-tests/females.groovy +++ /dev/null @@ -1,9 +0,0 @@ -import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; - -class FemalesCohortDefinition extends GenderCohortDefinition { - - public FemalesCohortDefinition() { - setFemaleIncluded(true); - } - -} \ No newline at end of file diff --git a/api-tests/invalidCohortDefinition.groovy b/api-tests/invalidCohortDefinition.groovy deleted file mode 100644 index 9cc900580b..0000000000 --- a/api-tests/invalidCohortDefinition.groovy +++ /dev/null @@ -1,5 +0,0 @@ -class ThisDoesNotImplementCohortDefinition { - - String foobar; - -} \ No newline at end of file diff --git a/api-tests/pom.xml b/api-tests/pom.xml index f1a4243af4..667f96ddd5 100644 --- a/api-tests/pom.xml +++ b/api-tests/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module reporting - 1.16.0-SNAPSHOT + 2.2.0-SNAPSHOT reporting-api-tests @@ -30,11 +30,6 @@ - - org.openmrs.module - ${reportingApiConditionalArtifactId} - ${project.parent.version} - org.openmrs.api @@ -45,6 +40,14 @@ javassist javassist + + org.powermock + powermock-api-mockito2 + + + org.powermock + powermock-api-mockito + @@ -57,6 +60,14 @@ javassist javassist + + org.powermock + powermock-api-mockito2 + + + org.powermock + powermock-api-mockito + @@ -69,6 +80,14 @@ javassist javassist + + org.powermock + powermock-api-mockito2 + + + org.powermock + powermock-api-mockito + @@ -114,4 +133,4 @@ ${project.parent.groupId}.${project.parent.artifactId} - + \ No newline at end of file diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/calculation/PatientDataCalculationBehaviorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/calculation/PatientDataCalculationBehaviorTest.java index a52f73b087..341cffdf90 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/calculation/PatientDataCalculationBehaviorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/calculation/PatientDataCalculationBehaviorTest.java @@ -1,21 +1,18 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -51,8 +48,8 @@ public void setup() throws Exception { public void evaluate_shouldEvaluateAPatientCalculation() throws Exception { Integer patientId1 = 2; Integer patientId2 = 7; - Set identifiers1 = ps.getPatient(patientId1).getIdentifiers(); - Set identifiers2 = ps.getPatient(patientId2).getIdentifiers(); + Set identifiers1 = new HashSet<>(ps.getPatient(patientId1).getIdentifiers()); + Set identifiers2 = new HashSet<>(ps.getPatient(patientId2).getIdentifiers()); PatientDataCalculation calculation = new PatientDataCalculationProvider().getCalculation( "org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition", null); Map parameters = new HashMap(); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/CohortsTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/CohortsTest.java index 5a6758cfbb..d48aa8fe4b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/CohortsTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/CohortsTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluatorTest.java index f1dbee5d2f..99eab544d9 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluatorTest.java @@ -1,22 +1,20 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.openmrs.Cohort; import org.openmrs.Patient; +import org.openmrs.api.PatientService; import org.openmrs.api.context.Context; import org.openmrs.contrib.testdata.TestDataManager; import org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition; @@ -44,6 +42,17 @@ public class AgeCohortDefinitionEvaluatorTest extends BaseModuleContextSensitive @Autowired TestDataManager tdf; + + @Autowired + PatientService patientService; + + @Before + // This is needed due to a change to standardTestDataset in the OpenMRS 2.2 release that changed person 6 birth year from 2007 to 1975 + public void setup() { + Patient p = patientService.getPatient(6); + p.setBirthdate(DateUtil.getDateTime(2007, 5, 27)); + patientService.savePatient(p); + } @Test public void evaluate_shouldReturnOnlyPatientsBornOnOrBeforeTheEvaluationDate() throws Exception { diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluatorTest.java index 7eac705b3a..8e46e03490 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AnEvaluatableCohortDefinition.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AnEvaluatableCohortDefinition.java index 4a6c77642c..b5061fc8b7 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AnEvaluatableCohortDefinition.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/AnEvaluatableCohortDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.openmrs.module.reporting.cohort.EvaluatedCohort; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluatorTest.java index a0686c729d..a186f394ac 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Assert; @@ -153,4 +162,29 @@ public void evaluate_shouldFindPatientsThatDiedAfterTheSpecifiedDate() throws Ex Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); Assert.assertFalse(cohort.contains(patientId)); } + + /** + * @see {@link BirthAndDeathCohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)} + */ + @Test + public void evaluate_shouldReturnPatientsWhoDiedWithoutDeathDate() throws Exception { + BirthAndDeathCohortDefinition cd = new BirthAndDeathCohortDefinition(); + { + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(23)); + Assert.assertTrue(cohort.contains(24)); + } + { + cd.setDied(true); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(23)); + Assert.assertFalse(cohort.contains(24)); + } + { + cd.setDied(false); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertFalse(cohort.contains(23)); + Assert.assertTrue(cohort.contains(24)); + } + } } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluatorTest.java index 0885f915ae..f84e027cf8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluatorTest.java index 297212de66..4bb0a0e1b4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluatorTest.java new file mode 100644 index 0000000000..c782a9e15e --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluatorTest.java @@ -0,0 +1,180 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.cohort.definition.evaluator; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openmrs.Cohort; +import org.openmrs.Concept; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.cohort.definition.ConditionCohortDefinition; +import org.openmrs.module.reporting.cohort.definition.service.CohortDefinitionService; +import org.openmrs.module.reporting.common.DateUtil; +import org.openmrs.test.BaseModuleContextSensitiveTest; + +public class ConditionCohortDefinitionEvaluatorTest extends BaseModuleContextSensitiveTest { + + protected static final String CONDITION_TEST_DATASET = "org/openmrs/module/reporting/include/ConditionCohortDefinitionEvaluatorTestDataSet.xml"; + + private ConditionCohortDefinition cd; + + @Before + public void setup() throws Exception { + initializeInMemoryDatabase(); + cd = new ConditionCohortDefinition(); + executeDataSet(CONDITION_TEST_DATASET); + } + + @After + public void tearDown() { + cd = null; + } + + @Test + public void evaluateShouldReturnAllPatients() throws Exception { + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(3)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertTrue(cohort.contains(5)); + Assert.assertEquals(5, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithConcept() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(3)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(4, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithConceptAndNonCodedValue() throws Exception { + cd.setConditionNonCoded("NON-CODED-CONDITION"); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(4)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithCreatedOnOrAfter() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setCreatedOnOrAfter(DateUtil.getDateTime(2014, 03, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(3)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithOnSetDateOnOrAfter() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setOnsetDateOnOrAfter(DateUtil.getDateTime(2014, 03, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(3)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithEndDateOnOrAfter() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setEndDateOnOrAfter(DateUtil.getDateTime(2016, 05, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(3)); + Assert.assertEquals(3, cohort.size()); + } + + + + @Test + public void evaluateShouldFilterPatientsWithCreatedOnOrBefore() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setCreatedOnOrBefore(DateUtil.getDateTime(2014, 03, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(3)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithOnSetDateOnOrBefore() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setOnsetDateOnOrBefore(DateUtil.getDateTime(2014, 03, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(3)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithEndDateOnOrBefore() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setEndDateOnOrBefore(DateUtil.getDateTime(2016, 05, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(1, cohort.size()); + } + + + + @Test + public void evaluateShouldFilterPatientsBetweenDateRanges() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setCreatedOnOrAfter(DateUtil.getDateTime(2014, 02, 12)); + cd.setCreatedOnOrBefore(DateUtil.getDateTime(2014, 04, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(3)); + Assert.assertEquals(1, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithActiveOnDate() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setConditionCoded(concept); + cd.setActiveOnDate(DateUtil.getDateTime(2014, 04, 12)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(3)); + Assert.assertTrue(cohort.contains(4)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldFilterPatientsWithAllParams() throws Exception { + Concept concept = Context.getConceptService().getConcept(409); + cd.setCreatedOnOrAfter(DateUtil.getDateTime(2015, 01, 10)); + cd.setCreatedOnOrBefore(DateUtil.getDateTime(2015, 01, 14)); + cd.setConditionCoded(concept); + cd.setConditionNonCoded("NON-CODED-CONDITION2"); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cd, null); + Assert.assertTrue(cohort.contains(1)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertEquals(2, cohort.size()); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluatorTest.java index 7d07eeebc2..d7a1ba4c73 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluatorTest.java index ba91762ef9..ff36853b5b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluatorTest.java index a4153042b4..8c81d71f9a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluatorTest.java new file mode 100644 index 0000000000..d0510ce9bc --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluatorTest.java @@ -0,0 +1,263 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ + +package org.openmrs.module.reporting.cohort.definition.evaluator; + +import org.apache.commons.lang3.time.DateUtils; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openmrs.CareSetting; +import org.openmrs.Cohort; +import org.openmrs.Concept; +import org.openmrs.Drug; +import org.openmrs.api.OrderService; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition; +import org.openmrs.module.reporting.cohort.definition.service.CohortDefinitionService; +import org.openmrs.module.reporting.common.DateUtil; +import org.openmrs.module.reporting.common.Match; +import org.openmrs.test.BaseModuleContextSensitiveTest; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +public class DrugOrderCohortDefinitionEvaluatorTest extends BaseModuleContextSensitiveTest { + + protected static final String TEST_DATA = "org/openmrs/module/reporting/include/DrugOrderCohortEvaluationData.xml"; + private DrugOrderCohortDefinition cohortDefinition; + + @Before + public void setup() throws Exception { + cohortDefinition = new DrugOrderCohortDefinition(); + executeDataSet(TEST_DATA); + } + + @After + public void tearDown() { + cohortDefinition = null; + } + + @Test + public void evaluateShouldReturnAllPatients() throws Exception { + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(5, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsCurrentlyActiveOnDrugs() throws Exception { + cohortDefinition.setActiveOnOrAfter(new Date()); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsCurrentlyNotActiveOnDrugs() throws Exception { + + cohortDefinition.setActiveOnOrBefore(DateUtils.addDays(new Date(2013, 12, 2), -1)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveTakenAnyofListedDrugs() throws Exception { + List drugSetList = new ArrayList(); + drugSetList.add(new Concept(88)); + drugSetList.add(new Concept(792)); + cohortDefinition.setDrugSets(drugSetList); + cohortDefinition.setWhich(Match.ANY); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertEquals(2, cohort.size()); + + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveTakenAnyListedDrugByDefault() throws Exception { + List drugSetList = new ArrayList(); + drugSetList.add(new Concept(3)); + drugSetList.add(new Concept(792)); + cohortDefinition.setDrugSets(drugSetList); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(4, cohort.size()); + + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveTakenAnyofDrugs() throws Exception { + List drugs = new ArrayList(); + drugs.add(new Drug(3)); + drugs.add(new Drug(2)); + cohortDefinition.setDrugs(drugs); + cohortDefinition.setWhich(Match.ANY); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertEquals(2, cohort.size()); + + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveTakenAnyDrugByDefault() throws Exception { + List drugs = new ArrayList(); + drugs.add(new Drug(11)); + drugs.add(new Drug(2)); + cohortDefinition.setDrugs(drugs); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(4, cohort.size()); + + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveNeverTakenDrugs() throws Exception { + List drugs = new ArrayList(); + drugs.add(new Drug(3)); + drugs.add(new Drug(2)); + cohortDefinition.setDrugs(drugs); + cohortDefinition.setWhich(Match.NONE); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveNeverTakenListedDrugs() throws Exception { + List drugSetList = new ArrayList(); + drugSetList.add(new Concept(88)); + drugSetList.add(new Concept(792)); + cohortDefinition.setDrugSets(drugSetList); + cohortDefinition.setWhich(Match.NONE); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(3, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsThatHaveTakenAllListedDrugs() throws Exception { + List drugSetList = new ArrayList(); + drugSetList.add(new Concept(88)); + drugSetList.add(new Concept(792)); + cohortDefinition.setDrugSets(drugSetList); + cohortDefinition.setWhich(Match.ALL); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertEquals(1, cohort.size()); + Assert.assertTrue(cohort.contains(2)); + } + + @Test + public void evaluateShouldReturnAllPatientsNotActiveOnDrugsAfterDate() throws Exception { + cohortDefinition.setActiveOnOrBefore(DateUtil.getDateTime(2013, 12, 2)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsCurrentlyActiveOnDrugsFromDate() throws Exception { + cohortDefinition.setActiveOnOrAfter(DateUtil.getDateTime(2013, 12, 7)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(22)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertEquals(4, cohort.size()); + } + @Test + public void evaluateShouldReturnAllPatientsWhoStartedTakingDrugsBeforeSpecifiedDate() throws Exception { + cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsWhoStartedTakingDrugsAfterSpecifiedDate() throws Exception { + cohortDefinition.setActivatedOnOrAfter(DateUtil.getDateTime(2008, 8, 10)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertEquals(2, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsOnDrugsOnSpecifiedDate() throws Exception { + cohortDefinition.setActiveOnDate(DateUtil.getDateTime(2007, 12, 3)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertEquals(1, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsTakingAnyDrugWithinADateRange() throws Exception { + cohortDefinition.setActivatedOnOrAfter(DateUtil.getDateTime(2008, 8, 1)); + cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 8)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(5, cohort.size()); + } + + @Test + public void evaluateShouldReturnAllPatientsTakingSpecifiedDrugBeforeDate() throws Exception { + List drugSetList = new ArrayList(); + drugSetList.add(new Concept(88)); + cohortDefinition.setDrugSets(drugSetList); + cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + } + + @Test + public void evaluateShouldReturnAllInSpecifiedCareSetting() throws Exception { + CareSetting careSetting = Context.getService(OrderService.class).getCareSetting(1); + cohortDefinition.setCareSetting(careSetting); + Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); + Assert.assertTrue(cohort.contains(2)); + Assert.assertTrue(cohort.contains(7)); + Assert.assertTrue(cohort.contains(8)); + Assert.assertTrue(cohort.contains(21)); + Assert.assertTrue(cohort.contains(22)); + Assert.assertEquals(5, cohort.size()); + + } +} \ No newline at end of file diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java index 31781560df..9df515e484 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import java.util.ArrayList; @@ -5,9 +14,9 @@ import java.util.Collections; import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.openmrs.Cohort; import org.openmrs.Encounter; import org.openmrs.EncounterType; @@ -25,17 +34,21 @@ import org.openmrs.module.reporting.common.TimeQualifier; import org.openmrs.module.reporting.definition.DefinitionContext; import org.openmrs.module.reporting.evaluation.EvaluationContext; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; import org.openmrs.test.Verifies; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; +@SkipBaseSetup public class EncounterCohortDefinitionEvaluatorTest extends BaseModuleContextSensitiveTest { protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset"; - @Before + @BeforeEach public void setup() throws Exception { + initializeInMemoryDatabase(); + authenticate(); executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); } @@ -192,7 +205,7 @@ public void evaluate_shouldReturnCorrectPatientsWhenTimeQualifierParametersAreSe * @see EncounterCohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext) * @verifies return correct patients when provider parameters are set */ - @Ignore + @Disabled @Test public void evaluate_shouldReturnCorrectPatientsWhenProviderParametersAreSet() throws Exception { EncounterCohortDefinition cd = new EncounterCohortDefinition(); @@ -203,7 +216,7 @@ public void evaluate_shouldReturnCorrectPatientsWhenProviderParametersAreSet() t /** * @see {@link EncounterCohortDefinitionEvaluator#evaluate(CohortDefinition,EvaluationContext)} */ - @Ignore + @Disabled @Test @Verifies(value = "should not return voided patients", method = "evaluate(CohortDefinition,EvaluationContext)") public void evaluate_shouldNotReturnVoidedPatients() throws Exception { @@ -232,8 +245,8 @@ public void evaluate_shouldNotReturnVoidedPatients() throws Exception { public void evaluate_shouldFindPatientsWithEncountersOnTheOnOrBeforeDateIfPassedInTimeIsAtMidnight() throws Exception { EncounterService es = Context.getEncounterService(); Encounter enc = es.getEncounter(3); - final Integer patentId = 7; - Assert.assertEquals(patentId, enc.getPatient().getPatientId());//sanity check + final Integer patientId = 7; + Assert.assertEquals(patientId, enc.getPatient().getPatientId());//sanity check enc.setEncounterDatetime(DateUtil.getDateTime(2005, 8, 1, 11, 0, 0, 0)); es.saveEncounter(enc); Context.flushSession();//because the query will compare with the value in the DB @@ -241,7 +254,7 @@ public void evaluate_shouldFindPatientsWithEncountersOnTheOnOrBeforeDateIfPassed EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.setOnOrBefore(DateUtil.getDateTime(2005, 8, 1)); Cohort c = Context.getService(CohortDefinitionService.class).evaluate(cd, null); - Assert.assertTrue(c.contains(patentId)); + Assert.assertTrue(c.contains(patientId)); } /** @@ -251,17 +264,15 @@ public void evaluate_shouldFindPatientsWithEncountersOnTheOnOrBeforeDateIfPassed @Verifies(value = "should find patients with encounters created on the specified date if passed in time is at midnight", method = "evaluate(CohortDefinition,EvaluationContext)") public void evaluate_shouldFindPatientsWithEncountersCreatedOnTheSpecifiedDateIfPassedInTimeIsAtMidnight() throws Exception { + executeDataSet(XML_DATASET_PATH + "ReportTestDataset-encounter-before-midnight.xml"); EncounterService es = Context.getEncounterService(); - Encounter enc = es.getEncounter(3); - final Integer patentId = 7; - Assert.assertEquals(patentId, enc.getPatient().getPatientId()); - enc.setDateCreated(DateUtil.getDateTime(2005, 8, 1, 11, 0, 0, 0)); - es.saveEncounter(enc); - Context.flushSession(); + Encounter enc = es.getEncounter(13); + final Integer patientId = 7; + Assert.assertEquals(patientId, enc.getPatient().getPatientId()); EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.setCreatedOnOrBefore(DateUtil.getDateTime(2005, 8, 1)); Cohort c = Context.getService(CohortDefinitionService.class).evaluate(cd, null); - Assert.assertTrue(c.contains(patentId)); + Assert.assertTrue(c.contains(patientId)); } } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluatorTest.java index e49f897d2f..7282b9aea0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluatorTest.java index 6bf5b2f445..d4d8338025 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import static org.hamcrest.core.Is.is; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluatorTest.java index 26843fd30c..fbcf6ccfd2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluatorTest.java index d69733ca03..5015e6bcdd 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluatorTest.java index e2a7a3ad9f..81737a44f3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluatorTest.java index 5ebf31bcdf..e9c5d4ede3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluatorTest.java index 7fe0d8b85e..8a3d490f25 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluatorTest.java index ab2e1ee193..02b888b4bd 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluatorTest.java index e229de35a4..a41ab48200 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluatorTest.java index 3c549f50c2..518044d419 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Assert; @@ -45,20 +54,20 @@ public void evaluate_shouldReturnPatientsWhoHaveIdentifiersOfThePassedTypes() th PatientIdentifierCohortDefinition picd = new PatientIdentifierCohortDefinition(); picd.addTypeToMatch(new PatientIdentifierType(2)); EvaluatedCohort c = Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()); - Assert.assertEquals(8, c.getSize()); + Assert.assertEquals(8, c.getMemberIds().size()); } { PatientIdentifierCohortDefinition picd = new PatientIdentifierCohortDefinition(); picd.addTypeToMatch(new PatientIdentifierType(1)); EvaluatedCohort c = Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()); - Assert.assertEquals(3, c.getSize()); + Assert.assertEquals(3, c.getMemberIds().size()); } { PatientIdentifierCohortDefinition picd = new PatientIdentifierCohortDefinition(); picd.addTypeToMatch(new PatientIdentifierType(1)); picd.addTypeToMatch(new PatientIdentifierType(2)); EvaluatedCohort c = Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()); - Assert.assertEquals(10, c.getSize()); + Assert.assertEquals(10, c.getMemberIds().size()); } } @@ -70,9 +79,9 @@ public void evaluate_shouldReturnPatientsWhoHaveIdentifiersOfThePassedTypes() th public void evaluate_shouldReturnPatientsWhoHaveIdentifiersMatchingThePassedLocations() throws Exception { PatientIdentifierCohortDefinition picd = new PatientIdentifierCohortDefinition(); picd.addTypeToMatch(new PatientIdentifierType(2)); - Assert.assertEquals(8, Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()).size()); + Assert.assertEquals(8, Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()).getMemberIds().size()); picd.addLocationToMatch(new Location(3)); - Assert.assertEquals(1, Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()).size()); + Assert.assertEquals(1, Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()).getMemberIds().size()); } /** @@ -122,4 +131,4 @@ public void evaluate_shouldReturnPatientsWhoHaveIdentifiersMatchingThePassedRegu EvaluatedCohort c = Context.getService(CohortDefinitionService.class).evaluate(picd, new EvaluationContext()); Assert.assertEquals(4, c.size()); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluatorTest.java index fcb1c64fd3..dc03e71c4c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluatorTest.java index f697eff155..fce60c57fc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluatorTest.java index ec1ec27bac..f6528e6ef5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluatorTest.java index de1a122cf3..94cf966ae3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluatorTest.java index 33f4a6c117..2e55deb021 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluatorTest.java index ab2148986f..3e2b85234b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluatorTest.java index 51c6aab477..af9e268ee6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java index 692de99ac7..12db3e1db6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.evaluator; import org.junit.Before; @@ -73,7 +68,7 @@ public void setUp() throws Exception { @Test public void testEvaluateWithNoProperties() throws Exception { Cohort c = cohortDefinitionService.evaluate(cd, null); - assertThat(c.size(), is(2)); + assertThat(c.size(), is(3)); } @Test @@ -98,7 +93,7 @@ public void testEvaluateInverse() throws Exception { @Test public void shouldIncludeVisit_ifActiveVisitRangeWithinVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -119,7 +114,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeWithinVisit() throws Exception @Test public void shouldIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndDuringVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -140,7 +135,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndDuri @Test public void shouldIncludeVisit_ifActiveVisitRangeStartDuringVisitAndRangeEndAfterVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -161,7 +156,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartDuringVisitAndRangeEndAfte @Test public void shouldIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndAfterVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -182,7 +177,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndAfte @Test public void shouldIncludeVisit_ifActiveVisitRangeEndSameAsVisitStart() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -203,7 +198,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeEndSameAsVisitStart() throws Ex @Test public void shouldIncludeVisit_ifActiveVisitRangeStartSameAsVisitEnd() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -225,7 +220,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartSameAsVisitEnd() throws Ex @Test public void shouldNotIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndBeforeVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -244,7 +239,7 @@ public void shouldNotIncludeVisit_ifActiveVisitRangeStartBeforeVisitAndRangeEndB @Test public void shouldIncludeVisit_ifActiveVisitRangeStartAfterVisitAndRangeEndAfterVisit() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -263,7 +258,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartAfterVisitAndRangeEndAfter @Test public void shouldIncludeVisit_ifActiveVisitRangeStartAfterVisitStartAndVisitCurrentlyActive() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") @@ -282,7 +277,7 @@ public void shouldIncludeVisit_ifActiveVisitRangeStartAfterVisitStartAndVisitCur @Test public void shouldNotIncludeVisit_ifActiveVisitRangeEndBeforeVisitStartAndVisitCurrentlyActive() throws Exception { - Patient patient = data.randomPatient().save(); + Patient patient = data.randomPatient().birthdate("1975-05-27").save(); // early dates to avoid active visits in standard test dataset Visit visit = data.visit() .started("1999-01-01") diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibraryTest.java index 4901e72b0f..31aecdbec4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibraryTest.java @@ -1,25 +1,22 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.library; import org.junit.Before; import org.junit.Test; +import org.openmrs.Concept; import org.openmrs.EncounterType; import org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition; import org.openmrs.module.reporting.cohort.definition.BirthAndDeathCohortDefinition; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.cohort.definition.ConditionCohortDefinition; import org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition; import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; import org.openmrs.module.reporting.cohort.definition.MappedParametersCohortDefinition; @@ -148,4 +145,19 @@ public void testGetDiedDuringPeriod() throws Exception { assertThat(cd, hasParameter("startDate", Date.class)); assertThat(cd, hasParameter("endDate", Date.class)); } + + @Test + public void testGetConditonSearchAdavanced() throws Exception { + CohortDefinition cd = library.getConditonSearchAdvanced(); + assertTrue(ConditionCohortDefinition.class.isAssignableFrom(cd.getClass())); + assertThat(cd, hasParameter("onsetDateOnOrBefore", Date.class)); + assertThat(cd, hasParameter("onsetDateOnOrAfter", Date.class)); + assertThat(cd, hasParameter("endDateOnOrBefore", Date.class)); + assertThat(cd, hasParameter("endDateOnOrAfter", Date.class)); + assertThat(cd, hasParameter("createdOnOrBefore", Date.class)); + assertThat(cd, hasParameter("createdOnOrAfter", Date.class)); + assertThat(cd, hasParameter("activeOnDate", Date.class)); + assertThat(cd, hasParameter("conditionNonCoded", String.class)); + assertThat(cd, hasParameter("conditionCoded", Concept.class)); + } } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/service/BaseCohortDefinitionServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/service/BaseCohortDefinitionServiceTest.java index b96586b1e8..dee399e8dc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/service/BaseCohortDefinitionServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/definition/service/BaseCohortDefinitionServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.service; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceTest.java index 6e0f954af1..455f63609d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.query.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/AgeTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/AgeTest.java index 500fefbccd..bc21ac7fd2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/AgeTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/AgeTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.common; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/DateRangeTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/DateRangeTest.java index 0756c52a2d..ffb83aa77b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/DateRangeTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/DateRangeTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import java.util.Date; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/DateUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/DateUtilTest.java index 7e8a7b369c..ac2566e8e5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/DateUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/DateUtilTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/DelimitedKeyComparatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/DelimitedKeyComparatorTest.java index c39a67cc5a..6a5013a3e6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/DelimitedKeyComparatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/DelimitedKeyComparatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelBuilderTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelBuilderTest.java index 40d461c3c9..840fcfcd76 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelBuilderTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelBuilderTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelUtilTest.java index 6e53ad5f26..333692126e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ExcelUtilTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/FractionTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/FractionTest.java index 4082157505..d6f5547768 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/FractionTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/FractionTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ObjectUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ObjectUtilTest.java index 2e041687cc..169df9d80c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/ObjectUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ObjectUtilTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ReflectionUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ReflectionUtilTest.java index dbd9ae4d7d..4ca680345a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/ReflectionUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ReflectionUtilTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import static org.hamcrest.Matchers.is; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ReportingMatchers.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ReportingMatchers.java index 91b9880157..e1a165f7b3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/ReportingMatchers.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ReportingMatchers.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.common; import org.hamcrest.BaseMatcher; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/ResultSetIteratorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/ResultSetIteratorTest.java new file mode 100644 index 0000000000..27e18c091d --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/ResultSetIteratorTest.java @@ -0,0 +1,86 @@ +package org.openmrs.module.reporting.common; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openmrs.module.reporting.dataset.DataSetRow; + +import javax.sql.rowset.RowSetMetaDataImpl; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + + +public class ResultSetIteratorTest { + + private ResultSet mockResultSet; + + private Statement mockStatement; + + private ResultSetIterator resultSetIterator; + + @Before + public void setUp() throws SQLException { + mockResultSet = mock(ResultSet.class); + mockStatement = mock(Statement.class); + when(mockResultSet.getStatement()).thenReturn(mockStatement); + when(mockResultSet.getMetaData()).thenReturn(createMetadata()); + resultSetIterator = new ResultSetIterator(mockResultSet); + mockResultSet(); + } + + @Test + public void shouldRead3LinesWithHasNext() { + List rows = new LinkedList(); + for (Iterator i = resultSetIterator; i.hasNext(); ) { + DataSetRow row = (DataSetRow) i.next(); + rows.add(row); + } + Assert.assertEquals(3, rows.size()); + Assert.assertEquals("result_01", rows.get(0).getColumnValue("Column_01")); + Assert.assertEquals("result_02", rows.get(0).getColumnValue("Column_02")); + Assert.assertEquals("result_03", rows.get(1).getColumnValue("Column_01")); + Assert.assertEquals("result_04", rows.get(1).getColumnValue("Column_02")); + Assert.assertEquals("result_05", rows.get(2).getColumnValue("Column_01")); + Assert.assertEquals("result_06", rows.get(2).getColumnValue("Column_02")); + } + + @Test + public void shouldRead3LinesWithoutHasNext() { + List rows = new LinkedList(); + DataSetRow row = resultSetIterator.next(); + while (row != null) { + rows.add(row); + row = resultSetIterator.next(); + } + + Assert.assertEquals(3, rows.size()); + Assert.assertEquals("result_01", rows.get(0).getColumnValue("Column_01")); + Assert.assertEquals("result_02", rows.get(0).getColumnValue("Column_02")); + Assert.assertEquals("result_03", rows.get(1).getColumnValue("Column_01")); + Assert.assertEquals("result_04", rows.get(1).getColumnValue("Column_02")); + Assert.assertEquals("result_05", rows.get(2).getColumnValue("Column_01")); + Assert.assertEquals("result_06", rows.get(2).getColumnValue("Column_02")); + } + + private ResultSetMetaData createMetadata() throws SQLException { + RowSetMetaDataImpl metaData = new RowSetMetaDataImpl(); + metaData.setColumnCount(2); + metaData.setColumnLabel(1, "Column_01"); + metaData.setColumnLabel(2, "Column_02"); + return metaData; + } + + private void mockResultSet() throws SQLException { + when(mockResultSet.next()).thenReturn(true, true, true, false); + when(mockResultSet.getObject(1)).thenReturn("result_01", "result_03", "result_05"); + when(mockResultSet.getObject(2)).thenReturn("result_02", "result_04", "result_06"); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/SqlRunnerTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/SqlRunnerTest.java new file mode 100644 index 0000000000..494ce287c2 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/SqlRunnerTest.java @@ -0,0 +1,21 @@ +package org.openmrs.module.reporting.common; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SqlRunnerTest { + + @Test + public void parseParametersIntoStatements_shouldEscapeParametersWithSingleQuotes() throws Exception { + SqlRunner sqlRunner = new SqlRunner(null); + Map parameters = new HashMap(); + parameters.put("generatedBy", "Fredrick 'Fred' Flintstone"); + List results = sqlRunner.parseParametersIntoStatements(parameters); + Assert.assertEquals("set @generatedBy='Fredrick ''Fred'' Flintstone'", results.get(0)); + } + +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/common/TestUtil.java b/api-tests/src/test/java/org/openmrs/module/reporting/common/TestUtil.java index e227196715..5298bdd833 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/common/TestUtil.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/common/TestUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import java.io.BufferedReader; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderIntegrationTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderIntegrationTest.java new file mode 100644 index 0000000000..0217075862 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderIntegrationTest.java @@ -0,0 +1,155 @@ +package org.openmrs.module.reporting.config; + +import org.hibernate.cfg.Environment; +import org.junit.Test; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.cohort.definition.library.BuiltInCohortDefinitionLibrary; +import org.openmrs.module.reporting.dataset.DataSetRow; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.parameter.Mapped; +import org.openmrs.module.reporting.evaluation.querybuilder.SqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.openmrs.module.reporting.report.ReportData; +import org.openmrs.module.reporting.report.ReportDesign; +import org.openmrs.module.reporting.report.ReportDesignResource; +import org.openmrs.module.reporting.report.definition.ReportDefinition; +import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; +import org.openmrs.module.reporting.report.service.ReportService; +import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.util.OpenmrsConstants; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import static org.hamcrest.CoreMatchers.endsWith; +import static org.hamcrest.CoreMatchers.hasItems; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.openmrs.module.reporting.config.ReportLoader.getReportingDescriptorsConfigurationDir; + +public class ReportLoaderIntegrationTest extends BaseModuleContextSensitiveTest { + + public static final String appDataTestDir = "testAppDataDir"; + + @Autowired @Qualifier("reportingReportDefinitionService") + ReportDefinitionService reportDefinitionService; + + @Autowired @Qualifier("reportingEvaluationService") + EvaluationService evaluationService; + + @Autowired + BuiltInCohortDefinitionLibrary cohorts; + + @Override + public Properties getRuntimeProperties() { + Properties p = super.getRuntimeProperties(); + String path = getClass().getClassLoader().getResource(appDataTestDir).getPath() + File.separator; + p.put("connection.url", p.getProperty(Environment.URL)); + p.put(Environment.URL, p.getProperty(Environment.URL) + ";MVCC=TRUE"); + p.put("connection.driver_class", p.getProperty(Environment.DRIVER)); + p.setProperty(OpenmrsConstants.APPLICATION_DATA_DIRECTORY_RUNTIME_PROPERTY, path); + System.setProperty("OPENMRS_APPLICATION_DATA_DIRECTORY", path); + return p; + } + + @Test + public void shouldLoadAllReportDescriptorsInReportDescriptorsDirectory() { + List reportDescriptors = ReportLoader.loadReportDescriptors(); + assertThat(reportDescriptors.size(), is(4)); + + List names = new ArrayList(); + for (ReportDescriptor reportDescriptor : reportDescriptors) { + names.add(reportDescriptor.getName()); + } + + assertThat(names, hasItems("sample.export.encounters.name","sample.export.orders.name", "sample.export.nested.name")); + } + + @Test + public void shouldLoadReportsFromConfigAndSave() { + ReportLoader.loadReportsFromConfig(); + + ReportDefinition ordersReportDefinition = reportDefinitionService.getDefinitionByUuid("9e7dc296-2aad-11e3-a840-5b9e0b589afb"); + ReportDefinition encountersReportDefinition = reportDefinitionService.getDefinitionByUuid("752e386d-da67-4e3d-bddc-95157c58c54c"); + ReportDefinition nestedReportDefinition = reportDefinitionService.getDefinitionByUuid("c2fb2082-9b36-4398-96af-d20570bacd07"); + + assertThat(ordersReportDefinition, notNullValue()); + assertThat(encountersReportDefinition, notNullValue()); + assertThat(nestedReportDefinition, notNullValue()); + + assertThat(ordersReportDefinition.getName(), is("sample.export.orders.name")); + assertThat(encountersReportDefinition.getName(), is("sample.export.encounters.name")); + assertThat(nestedReportDefinition.getName(), is("sample.export.nested.name")); + + List existingOrderReportDesigns = Context.getService(ReportService.class).getReportDesigns(ordersReportDefinition, null, true); + assertThat(existingOrderReportDesigns.size(), is(2)); + } + + @Test + public void shouldSupportFixedParametersInDataSetDefinitions() throws Exception { + ReportLoader.loadReportsFromConfig(); + ReportDefinition rd = reportDefinitionService.getDefinitionByUuid("0c32f660-c2de-11eb-b5a4-0242ac110002"); + assertThat(rd.getParameters().size(), is(2)); + Mapped maleMapped = rd.getDataSetDefinitions().get("males"); + Mapped femaleMapped = rd.getDataSetDefinitions().get("females"); + assertThat(maleMapped.getParameterizable().getParameters().size(), is(3)); + assertThat(femaleMapped.getParameterizable().getParameters().size(), is(3)); + assertThat(maleMapped.getParameterMappings().get("gender").toString(), is("M")); + assertThat(femaleMapped.getParameterMappings().get("gender").toString(), is("F")); + ReportData data = reportDefinitionService.evaluate(rd, new EvaluationContext()); + List rptMales = new ArrayList(); + List rptFemales = new ArrayList(); + for (DataSetRow row : data.getDataSets().get("males")) { + rptMales.add((Integer)row.getColumnValue("person_id")); + } + for (DataSetRow row : data.getDataSets().get("females")) { + rptFemales.add((Integer)row.getColumnValue("person_id")); + } + + SqlQueryBuilder maleQuery = new SqlQueryBuilder("select person_id from person where gender = 'M'"); + List males = evaluationService.evaluateToList(maleQuery, Integer.class, new EvaluationContext()); + + SqlQueryBuilder femaleQuery = new SqlQueryBuilder("select person_id from person where gender = 'F'"); + List females = evaluationService.evaluateToList(femaleQuery, Integer.class, new EvaluationContext()); + + assertThat(males.size(), is(rptMales.size())); + assertThat(females.size(), is(rptFemales.size())); + assertTrue(males.containsAll(rptMales)); + assertTrue(females.containsAll(rptFemales)); + } + + @Test + public void shouldConstructExcelReportDesign() { + ReportDefinition reportDefinition = new ReportDefinition(); + reportDefinition.setName("My Test Report"); + + DesignDescriptor designDescriptor = new DesignDescriptor(); + designDescriptor.setType("excel"); + designDescriptor.setTemplate("templates/SampleReportTemplate.xls"); + + ReportDescriptor reportDescriptor = new ReportDescriptor(); + reportDescriptor.setPath(new File(getReportingDescriptorsConfigurationDir())); + reportDescriptor.setDesigns(new ArrayList()); + reportDescriptor.getDesigns().add(designDescriptor); + + List reportDesigns = ReportLoader.constructReportDesigns(reportDefinition, reportDescriptor); + assertThat(reportDesigns.size(), is(1)); + assertThat(reportDesigns.get(0).getName(), is("reporting.excel")); + assertThat(reportDesigns.get(0).getRendererType().getName(), endsWith("XlsReportRenderer")); + assertThat(reportDesigns.get(0).getReportDefinition(), is(reportDefinition)); + + assertThat(reportDesigns.get(0).getResources().size(), is(1)); + ReportDesignResource reportDesignResource = reportDesigns.get(0).getResources().iterator().next(); + assertThat(reportDesignResource.getName(), is("template")); + assertThat(reportDesignResource.getExtension(), is("xls")); + assertThat(reportDesignResource.getContentType(), is("application/vnd.ms-excel")); + assertThat(reportDesignResource.getContents(), is(notNullValue())); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderTest.java new file mode 100644 index 0000000000..61f1ccb6f9 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/config/ReportLoaderTest.java @@ -0,0 +1,153 @@ +package org.openmrs.module.reporting.config; + +import org.junit.Test; +import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.module.reporting.report.ReportDesign; +import org.openmrs.module.reporting.report.definition.ReportDefinition; +import org.openmrs.module.reporting.report.renderer.ReportDesignRenderer; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import static org.hamcrest.CoreMatchers.endsWith; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; + +public class ReportLoaderTest { + + @Test + public void load_shouldLoadYAMLFile() { + + ClassLoader classLoader = getClass().getClassLoader(); + File sampleReport = new File(classLoader.getResource("config/sampleReport.yml").getFile()); + + ReportDescriptor descriptor = ReportLoader.load(sampleReport); + + assertThat(descriptor.getKey(), is("sampledataexport")); + assertThat(descriptor.getUuid(), is("9e7dc296-2aad-11e3-a840-5b9e0b589afb")); + assertThat(descriptor.getName(), is("sample.export.name")); + assertThat(descriptor.getDescription(), is("sample.export.description")); + assertThat(descriptor.getParameters().size(), is(2)); + assertThat(descriptor.getParameters().get(0).getKey(), is("startDate")); + assertThat(descriptor.getParameters().get(0).getType(), is("date")); + assertThat(descriptor.getParameters().get(0).getLabel(), is("startDate.label")); + assertThat(descriptor.getDatasets().size(), is(4)); + DataSetDescriptor ds0 = descriptor.getDatasets().get(0); + assertThat(ds0.getKey(), is("males")); + assertThat(ds0.getType(), is("sql")); + assertThat(ds0.getConfig(), is("persons.sql")); + assertThat(ds0.getParameters().size(), is(1)); + assertThat(ds0.getParameters().get(0).getKey(), is("gender")); + assertThat(ds0.getParameters().get(0).getValue(), is("M")); + DataSetDescriptor ds1 = descriptor.getDatasets().get(1); + assertThat(ds1.getKey(), is("females")); + assertThat(ds1.getType(), is("sql")); + assertThat(ds1.getConfig(), is("persons.sql")); + assertThat(ds1.getParameters().size(), is(1)); + assertThat(ds1.getParameters().get(0).getKey(), is("gender")); + assertThat(ds1.getParameters().get(0).getValue(), is("F")); + DataSetDescriptor ds2 = descriptor.getDatasets().get(2); + assertThat(ds2.getKey(), is("orders")); + assertThat(ds2.getType(), is("sql")); + assertThat(ds2.getConfig(), is("orders.sql")); + assertThat(ds2.getParameters().size(), is(0)); + assertThat(descriptor.getDesigns().get(0).getType(), is("csv")); + assertThat(descriptor.getDesigns().get(0).getProperties().get("characterEncoding"), is("ISO-8859-1")); + assertThat(descriptor.getDesigns().get(0).getProperties().get("blacklistRegex"), is("[^\\p{InBasicLatin}\\p{L}]")); + assertThat(descriptor.getDesigns().get(1).getType(), is("excel")); + assertThat(descriptor.getDesigns().get(1).getTemplate(), is("ExcelTemplate.xls")); + + assertThat(((List)descriptor.getConfig().get("categories")).size(), is(2)); + assertThat(((List)descriptor.getConfig().get("categories")).get(0), is("DATA_EXPORT")); + assertThat(((List)descriptor.getConfig().get("categories")).get(1), is("DAILY")); + + assertThat(((List)descriptor.getConfig().get("components")).size(), is(1)); + assertThat(((List)descriptor.getConfig().get("components")).get(0), is("encounters")); + + } + + @Test + public void shouldConstructParameters() { + + List parameterDescriptors = new ArrayList(); + + ParameterDescriptor startDate = new ParameterDescriptor(); + startDate.setKey("startDate"); + startDate.setLabel("startDate.label"); + startDate.setType("date"); + + ParameterDescriptor endDate = new ParameterDescriptor(); + endDate.setKey("endDate"); + endDate.setLabel("endDate.label"); + endDate.setType("java.util.Date"); + + ParameterDescriptor location = new ParameterDescriptor(); + location.setKey("location"); + location.setLabel("location.label"); + location.setType("Location"); + + parameterDescriptors.add(startDate); + parameterDescriptors.add(endDate); + parameterDescriptors.add(location); + + List parameters = ReportLoader.constructParameters(parameterDescriptors); + + assertThat(parameters.size(), is(3)); + assertThat(parameters.get(0).getLabel(), is("startDate.label")); + assertThat(parameters.get(0).getName(), is("startDate")); + assertThat(parameters.get(0).getType().getName(), is("java.util.Date")); + + assertThat(parameters.get(1).getLabel(), is("endDate.label")); + assertThat(parameters.get(1).getName(), is("endDate")); + assertThat(parameters.get(1).getType().getName(), is("java.util.Date")); + + assertThat(parameters.get(2).getLabel(), is("location.label")); + assertThat(parameters.get(2).getName(), is("location")); + assertThat(parameters.get(2).getType().getName(), is("org.openmrs.Location")); + + } + + @Test + public void shouldConstructCSVReportDesign() { + ReportDefinition reportDefinition = new ReportDefinition(); + reportDefinition.setName("My Test Report"); + + DesignDescriptor designDescriptor = new DesignDescriptor(); + designDescriptor.setType("csv"); + designDescriptor.setProperties(new HashMap()); + designDescriptor.getProperties().put("characterEncoding", "ISO-8859-1"); + designDescriptor.getProperties().put("blacklistRegex", "[^\\p{InBasicLatin}\\p{L}]"); + + ReportDescriptor reportDescriptor = new ReportDescriptor(); + reportDescriptor.setDesigns(new ArrayList()); + reportDescriptor.getDesigns().add(designDescriptor); + + List reportDesigns = ReportLoader.constructReportDesigns(reportDefinition, reportDescriptor); + assertThat(reportDesigns.size(), is(1)); + assertThat(reportDesigns.get(0).getName(), is("reporting.csv")); + assertThat(reportDesigns.get(0).getReportDefinition(), is(reportDefinition)); + assertThat(reportDesigns.get(0).getPropertyValue(ReportDesignRenderer.FILENAME_BASE_PROPERTY, null), startsWith("my.test.report.")); + assertThat(reportDesigns.get(0).getPropertyValue("characterEncoding", null), is("ISO-8859-1")); + assertThat(reportDesigns.get(0).getPropertyValue("blacklistRegex", null), is("[^\\p{InBasicLatin}\\p{L}]")); + + } + + @Test + public void shouldConstructCSVReportDesignIfNoDesignSpecified() { + ReportDefinition reportDefinition = new ReportDefinition(); + reportDefinition.setName("My Test Report"); + + ReportDescriptor reportDescriptor = new ReportDescriptor(); + + List reportDesigns = ReportLoader.constructReportDesigns(reportDefinition, reportDescriptor); + assertThat(reportDesigns.size(), is(1)); + assertThat(reportDesigns.get(0).getName(), is("reporting.csv")); + assertThat(reportDesigns.get(0).getRendererType().getName(), endsWith("CsvReportRenderer")); + assertThat(reportDesigns.get(0).getReportDefinition(), is(reportDefinition)); + assertThat(reportDesigns.get(0).getPropertyValue(ReportDesignRenderer.FILENAME_BASE_PROPERTY, null), startsWith("my.test.report.")); + } + +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/JoinDataDefinitionTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/JoinDataDefinitionTest.java index 9b70d4fd57..79380fa6a5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/JoinDataDefinitionTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/JoinDataDefinitionTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeConverterTest.java index 99cfdaa4b2..dd0c764810 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeConverterTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeRangeConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeRangeConverterTest.java index f9ce94061b..70bb59aad7 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeRangeConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AgeRangeConverterTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AttributeValueConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AttributeValueConverterTest.java index 45d3606de9..138b77ba42 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AttributeValueConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/AttributeValueConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateConverterTest.java index e5db522fd5..dbe0ee81c2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverterTest.java index 70cdbf00c8..44aecb6366 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import java.util.Date; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BooleanConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BooleanConverterTest.java index 4390af0eb9..5b880d8976 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BooleanConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/BooleanConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/DateConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/DateConverterTest.java index 3f8302183c..e396302d74 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/DateConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/DateConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import java.text.SimpleDateFormat; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ListConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ListConverterTest.java index dee1615f14..4c6f25f3a8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ListConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ListConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/MapConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/MapConverterTest.java index eb665cbe8e..52756bc564 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/MapConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/MapConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/NullValueConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/NullValueConverterTest.java index 38848b61cf..abb32cb929 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/NullValueConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/NullValueConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverterTest.java index 5d413affbe..f0e987ad75 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverterTest.java index 39853b237b..5ca08b9196 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import static org.hamcrest.CoreMatchers.is; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonAddressConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonAddressConverterTest.java index c29a028015..35a40f686d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonAddressConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonAddressConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonNameConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonNameConverterTest.java index 1ca290f52d..ec8fceb17d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonNameConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PersonNameConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java index 19cbf5d567..22a48c0a03 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverterTest.java @@ -1,19 +1,25 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.api.context.Context; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.openmrs.test.SkipBaseSetup; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; -@RunWith(PowerMockRunner.class) -@PrepareForTest(Context.class) -public class PrivilegedDataConverterTest { +@SkipBaseSetup +public class PrivilegedDataConverterTest extends BaseModuleContextSensitiveTest { public static final String INPUT = "input"; public static final String REPLACEMENT = "****"; @@ -21,18 +27,24 @@ public class PrivilegedDataConverterTest { public static final String HAS_PRIV = "A privilege I have"; public static final String DOES_NOT_HAVE_PRIV = "A privilege I do not have"; - @Before + @BeforeEach public void setUp() throws Exception { - PowerMockito.mockStatic(Context.class); - PowerMockito.when(Context.hasPrivilege(HAS_PRIV)).thenReturn(true); - PowerMockito.when(Context.hasPrivilege(DOES_NOT_HAVE_PRIV)).thenReturn(false); + initializeInMemoryDatabase(); + executeDataSet("org/openmrs/module/reporting/include/PrivilegeTest.xml"); } @Test - public void testConvertWithPrivilege() throws Exception { - PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV); - converter.setReplacement(REPLACEMENT); - assertThat((String) converter.convert(INPUT), is(INPUT)); + public void testConvertWithPrivilege() { + try { + Context.addProxyPrivilege(HAS_PRIV); + Context.hasPrivilege(HAS_PRIV); + PrivilegedDataConverter converter = new PrivilegedDataConverter(HAS_PRIV); + converter.setReplacement(REPLACEMENT); + assertThat((String) converter.convert(INPUT), is(INPUT)); + } + finally { + Context.removeProxyPrivilege(HAS_PRIV); + } } @Test diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PropertyConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PropertyConverterTest.java index d2525e1a4d..c60a1d2a60 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PropertyConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/PropertyConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/StringConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/StringConverterTest.java index ef657b776c..ffc0bb3902 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/StringConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/converter/StringConverterTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluatorTest.java index 75ecd633f2..cf48a14919 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluatorTest.java index 9a70d88c6f..76f89d5c1a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluatorTest.java index b1ee1c090f..f6e2885514 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluatorTest.java index 014cfa12dd..f87380ac77 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluatorTest.java index b5f0b4fc03..e86c8815ef 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluatorTest.java index 2bcedad330..5b347200b9 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Test; @@ -183,7 +192,7 @@ public void shouldIgnoredVoidedEncounterProviders() throws Exception { public void shouldFailIfEncounterRoleParameterSetToAnotherType() throws Exception { EncounterProviderDataDefinition d = new EncounterProviderDataDefinition(); - d.setEncounterRole(new User()); + d.setEncounterRole(new EncounterRole()); d.setSingleProvider(false); EncounterEvaluationContext encounterEvaluationContext = new EncounterEvaluationContext(); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluatorTest.java index 7de4cf556a..70e7d29163 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncountersForPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncountersForPatientDataEvaluatorTest.java index a485c9538e..e7ce440b90 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncountersForPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/EncountersForPatientDataEvaluatorTest.java @@ -1,5 +1,16 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; +import org.databene.benerator.util.SimpleRandom; +import org.joda.time.LocalDate; import org.junit.Test; import org.openmrs.Cohort; import org.openmrs.Encounter; @@ -10,6 +21,7 @@ import org.openmrs.VisitType; import org.openmrs.api.context.Context; import org.openmrs.contrib.testdata.TestDataManager; +import org.openmrs.contrib.testdata.builder.PatientBuilder; import org.openmrs.module.reporting.data.patient.EvaluatedPatientData; import org.openmrs.module.reporting.data.patient.definition.EncountersForPatientDataDefinition; import org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition; @@ -43,7 +55,13 @@ public void shouldReturnEncountersInActiveVisit() throws Exception { Context.getLocationService().saveLocation(location); EvaluationContext context = new EvaluationContext(); - Patient patient = data.randomPatient().save(); + PatientBuilder patientBuilder = data.randomPatient(); + + LocalDate visitDate = LocalDate.parse("2013-10-01"); + int minimumAge = LocalDate.now().getYear() - visitDate.getYear() + 1; + + patientBuilder.age(SimpleRandom.randomInt(minimumAge, 90)); + Patient patient = patientBuilder.save(); // add an older closed visit Visit v1 = data.visit().patient(patient).visitType(visitType).started("2013-10-01 09:30:00").stopped("2013-10-03 09:30:00").location(location).save(); Encounter e1 = data.randomEncounter().encounterType(encounterType).visit(v1).patient(patient).encounterDatetime("2013-10-01 10:30:00").location(location).save(); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterEvaluatorTest.java index c4fcb4f74d..e756e717cf 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; @@ -21,8 +30,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertNull; @@ -207,5 +219,40 @@ public void testShouldReturnEmptySetWhenInputSetIsEmpty() throws Exception { } + @Test + public void testEvaluateForObsWithAnswer() throws Exception { + + Concept civilStatus = conceptService.getConcept(4); + Concept single = conceptService.getConcept(5); + Concept married = conceptService.getConcept(6); + + // create an obs with a few members + Patient patient = data.randomPatient().save(); + Encounter enc1 = data.randomEncounter().patient(patient).save(); + Obs obs1 = data.obs().concept(civilStatus).value(single).encounter(enc1).save(); + Obs obs2 = data.obs().concept(civilStatus).value(married).encounter(enc1).save(); + EncounterEvaluationContext context = new EncounterEvaluationContext(); + context.setBaseEncounters(new EncounterIdSet(enc1.getId())); + + ObsForEncounterDataDefinition def = new ObsForEncounterDataDefinition(); + def.setQuestion(civilStatus); + def.setSingleObs(false); + + def.addAnswer(single); + EvaluatedEncounterData results = encounterDataService.evaluate(def, context); + + assertThat(results.getData().size(), is(1)); + List obsList = (List)results.getData().get(enc1.getId()); + assertThat(obsList.size(), is(1)); + assertThat(obsList, contains(obs1)); + + def.addAnswer(married); + results = encounterDataService.evaluate(def, context); + + assertThat(results.getData().size(), is(1)); + obsList = (List)results.getData().get(enc1.getId()); + assertThat(obsList.size(), is(2)); + assertThat(obsList, contains(obs1, obs2)); + } } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluatorTest.java new file mode 100644 index 0000000000..e79f620c26 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluatorTest.java @@ -0,0 +1,160 @@ +package org.openmrs.module.reporting.data.encounter.evaluator; + +import org.junit.Before; +import org.junit.Test; +import org.openmrs.Concept; +import org.openmrs.Encounter; +import org.openmrs.EncounterType; +import org.openmrs.Obs; +import org.openmrs.Patient; +import org.openmrs.api.ConceptService; +import org.openmrs.api.EncounterService; +import org.openmrs.contrib.testdata.TestDataManager; +import org.openmrs.module.reporting.common.DateUtil; +import org.openmrs.module.reporting.common.TestUtil; +import org.openmrs.module.reporting.data.encounter.EvaluatedEncounterData; +import org.openmrs.module.reporting.data.encounter.definition.ObsForEncounterDataDefinition; +import org.openmrs.module.reporting.data.encounter.definition.ObsOnSameDateEncounterDataDefinition; +import org.openmrs.module.reporting.data.encounter.service.EncounterDataService; +import org.openmrs.module.reporting.evaluation.context.EncounterEvaluationContext; +import org.openmrs.module.reporting.query.encounter.EncounterIdSet; +import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; + +import java.util.List; + +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; + +public class ObsOnSameDateEncounterDataEvaluatorTest extends BaseModuleContextSensitiveTest { + + protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; + + protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset"; + + @Autowired + private TestDataManager data; + + @Autowired + @Qualifier("conceptService") + private ConceptService conceptService; + + @Autowired + @Qualifier("encounterService") + private EncounterService encounterService; + + @Autowired + private EncounterDataService encounterDataService; + + /** + * Run this before each unit test in this class. The "@Before" method in + * {@link org.openmrs.test.BaseContextSensitiveTest} is run right before this method. + * + * @throws Exception + */ + @Before + public void setup() throws Exception { + executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); + } + + @Test + public void testEvaluateForObsOnSameEncounter() throws Exception { + + Concept weight = conceptService.getConcept(5089); + Concept cd4 = conceptService.getConcept(5497); + + // create an obs with a few members + Patient patient = data.randomPatient().save(); + Encounter enc1 = data.randomEncounter().patient(patient).save(); + Obs obs1 = data.obs().concept(weight).value(60).encounter(enc1).save(); + Obs obs2 = data.obs().concept(cd4).value(350).encounter(enc1).save(); + + EncounterEvaluationContext context = new EncounterEvaluationContext(); + context.setBaseEncounters(new EncounterIdSet(enc1.getId())); + + ObsOnSameDateEncounterDataDefinition def = new ObsOnSameDateEncounterDataDefinition(); + def.setQuestion(weight); + def.setSingleObs(true); + EvaluatedEncounterData results = encounterDataService.evaluate(def, context); + + assertThat(results.getData().size(), is(1)); + assertThat((Obs) results.getData().get(enc1.getId()), is(obs1)); + } + + @Test + public void testEvaluateForObsOnDifferentEncounters() throws Exception { + + Concept weight = conceptService.getConcept(5089); + Concept cd4 = conceptService.getConcept(5497); + + EncounterType vitalsEncounter = new EncounterType("VITALS", "Vitals encounter type"); + EncounterType artEncounter = new EncounterType("ART_FOLLOWUP", "ART visit encounter"); + encounterService.saveEncounterType(vitalsEncounter); + encounterService.saveEncounterType(artEncounter); + + // create an obs with a few members + Patient patient = data.randomPatient().save(); + Encounter enc1 = data.randomEncounter().patient(patient).save(); + enc1.setEncounterType(vitalsEncounter); + enc1.setEncounterDatetime(DateUtil.getDateTime(2017, 10, 1, 9, 30, 0, 0)); + Obs obs1 = data.obs().concept(weight).value(60).encounter(enc1).save(); + + + Encounter enc2 = data.randomEncounter().patient(patient).save(); + enc2.setEncounterType(artEncounter); + enc2.setEncounterDatetime(DateUtil.getDateTime(2017, 10, 1, 10, 30, 0, 0)); + Obs obs2 = data.obs().concept(cd4).value(350).encounter(enc2).save(); + + EncounterEvaluationContext context = new EncounterEvaluationContext(); + context.setBaseEncounters(new EncounterIdSet(enc2.getId())); + + ObsOnSameDateEncounterDataDefinition def = new ObsOnSameDateEncounterDataDefinition(); + def.setQuestion(weight); + def.setSingleObs(true); + EvaluatedEncounterData results = encounterDataService.evaluate(def, context); + + assertThat(results.getData().size(), is(1)); + // it should return the Weight obs captured on the same date but in different encounter than the context encounter + assertThat((Obs) results.getData().get(enc2.getId()), is(obs1)); + } + + @Test + public void testEvaluateForObsWithAnswer() throws Exception { + + Concept civilStatus = conceptService.getConcept(4); + Concept single = conceptService.getConcept(5); + Concept married = conceptService.getConcept(6); + + // create an obs with a few members + Patient patient = data.randomPatient().save(); + Encounter enc1 = data.randomEncounter().patient(patient).save(); + Encounter enc2 = data.randomEncounter().encounterDatetime(enc1.getEncounterDatetime()).patient(patient).save(); + Obs obs2 = data.obs().concept(civilStatus).value(married).encounter(enc2).save(); + + EncounterEvaluationContext context = new EncounterEvaluationContext(); + context.setBaseEncounters(new EncounterIdSet(enc1.getId())); + + // First show that a normal ObsForEncounterDataDefinition would not include the obs from different encounter on same date + ObsForEncounterDataDefinition def = new ObsForEncounterDataDefinition(); + def.setQuestion(civilStatus); + def.setSingleObs(false); + def.addAnswer(married); + + EvaluatedEncounterData results = encounterDataService.evaluate(def, context); + assertThat(results.getData().size(), is(0)); + + def = new ObsOnSameDateEncounterDataDefinition(); + def.setQuestion(civilStatus); + def.setSingleObs(false); + def.addAnswer(married); + + results = encounterDataService.evaluate(def, context); + assertThat(results.getData().size(), is(1)); + List obsList = (List)results.getData().get(enc1.getId()); + assertThat(obsList.size(), is(1)); + assertThat(obsList, contains(obs2)); + } + +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluatorTest.java index 8ba4175eff..df69f7804d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluatorTest.java index 8dfe885b4b..349d0c34de 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluatorTest.java index 08d75ad006..dd79996df4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluatorTest.java index 93ba17cf48..9173475efc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibraryTest.java index addcb14124..6f06492f21 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibraryTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.library; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImplTest.java index 15cbaeac72..030cdf0a2a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluatorTest.java index b60d42e964..985663064f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluatorTest.java index 794a2cf894..dec78b4116 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluatorTest.java index b49614cf89..137fffcfe2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluatorTest.java index 35c8779e88..6c0d14a7bf 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluatorTest.java index e2a09faa78..672768e78e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsEvaluatorTest.java index 9a8f41af83..530b7ce18c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluatorTest.java index 0482b3ff35..256e3a61ef 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluatorTest.java index d4f5dd0a8f..02bfe144e6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluatorTest.java index 4400a69540..501fef1c7c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.patient.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluatorTest.java index d5f83495f7..58f6f164da 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluatorTest.java index f326ee2054..ced30955e1 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluatorTest.java index 7199ad1d98..0aee3e3939 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluatorTest.java index 7049db7e6c..b4e13060c9 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluatorTest.java index c0ae3ee76d..8cd6eaa8b3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluatorTest.java index 479607b7c3..a543dc9649 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; @@ -80,7 +76,7 @@ public void evaluate_shouldReturnAllIdentifiersOfTheSpecifiedTypesInOrderForEach /** * @verifies return all identifiers in groups according to preferred list order - * @see PatientIdentifierDataEvaluator#evaluate(org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition, org.openmrs.module.reporting.evaluation.EvaluationContext) + * @see PatientIdentifierDataEvaluator#evaluate(PatientDataDefinition, EvaluationContext) */ @Test public void evaluate_shouldReturnAllIdentifiersInGroupsAccordingToPreferredListOrder() throws Exception { @@ -104,6 +100,24 @@ public void evaluate_shouldReturnAllIdentifiersInGroupsAccordingToPreferredListO Assert.assertEquals(pi1, identifiers.get(2).getIdentifierType()); } + /** + * @verifies return all identifiers in groups according to preferred list order + * @see PatientIdentifierDataEvaluator#evaluate(PatientDataDefinition, EvaluationContext) + */ + @Test + public void evaluate_shouldReturnAllIdentifiersIfNoTypeSpecified() throws Exception { + EvaluationContext context = new EvaluationContext(); + context.setBaseCohort(new Cohort("2")); + + PatientIdentifierDataDefinition d = new PatientIdentifierDataDefinition(); + + EvaluatedPatientData pd = Context.getService(PatientDataService.class).evaluate(d, context); + + Object o = pd.getData().get(2); + List identifiers = (List) o; + Assert.assertEquals(3, identifiers.size()); + } + /** * @verifies place all preferred identifiers first within type groups * @see PatientIdentifierDataEvaluator#evaluate(org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition, org.openmrs.module.reporting.evaluation.EvaluationContext) diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluatorTest.java index 8570df6ab3..4309e9737d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluatorTest.java index ac721fb34c..3e9f6959c3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluatorTest.java index 7d82270e96..ad404b526f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluatorTest.java index 514c798f0b..9484a687bc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluatorTest.java index b247030920..19b9e0caa1 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataEvaluatorTest.java index ff7cb40769..fa048c1ff0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluatorTest.java index 13e8227df3..048c9c1f7b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/TestPatientCalculation.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/TestPatientCalculation.java index 2c6e244ba6..81344cb03e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/TestPatientCalculation.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/evaluator/TestPatientCalculation.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibraryTest.java index 0e91a7301c..c0e36907cd 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibraryTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.patient.library; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java index 30157b957d..ddf17348c8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImplTest.java @@ -1,21 +1,17 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.service; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.Cohort; import org.openmrs.Patient; import org.openmrs.PersonAttribute; @@ -35,10 +31,10 @@ import org.openmrs.module.reporting.definition.library.DocumentedDefinition; import org.openmrs.module.reporting.evaluation.EvaluationContext; import org.openmrs.test.BaseContextSensitiveTest; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; import org.springframework.beans.factory.annotation.Autowired; -import java.util.Arrays; +import java.util.Collections; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.nullValue; @@ -63,7 +59,7 @@ public class PatientDataServiceImplTest extends BaseModuleContextSensitiveTest { * * @throws Exception */ - @Before + @BeforeEach public void setup() throws Exception { executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); } @@ -163,7 +159,7 @@ private CohortDefinition setUpTestPatientCohortDefinition(PersonAttributeType te PersonAttributeCohortDefinition cohortDefinition = new PersonAttributeCohortDefinition(); cohortDefinition.setName("Test Patients"); cohortDefinition.setAttributeType(testAttributeType); - cohortDefinition.setValues(Arrays.asList("true")); + cohortDefinition.setValues(Collections.singletonList("true")); Context.getService(CohortDefinitionService.class).saveDefinition(cohortDefinition); return cohortDefinition; } @@ -203,7 +199,7 @@ public String getKeyPrefix() { public CohortDefinition getTestPatients() { PersonAttributeCohortDefinition cohortDefinition = new PersonAttributeCohortDefinition(); cohortDefinition.setAttributeType(Context.getPersonService().getPersonAttributeTypeByUuid(TEST_PATIENT_ATTR_TYPE_UUID)); - cohortDefinition.setValues(Arrays.asList("true")); + cohortDefinition.setValues(Collections.singletonList("true")); return cohortDefinition; } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluatorTest.java index 30feab5fa6..8e190af39d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluatorTest.java index 8affd45af0..e86fc3d04f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluatorTest.java index bc4c5ad9e9..759234b847 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluatorTest.java index cc65e47488..4e3b111cba 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluatorTest.java index 5b528c9ca2..3c4673e0e8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluatorTest.java index bb6166a783..86602e2fa5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluatorTest.java index da1c58b75d..fc6d52c45a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluatorTest.java index 6b0c9d866e..38c4bba52d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluatorTest.java index ee4255e01c..3f32c3e3c3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluatorTest.java index 041e7ebfb8..c2f742a9bd 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluatorTest.java index f6e46d9ae8..d83e664a83 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluatorTest.java index 3ed234ca1f..0c11dd8643 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluatorTest.java index 9060f8b4e4..bd452f52b5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImplTest.java index 6c0d37a8b1..d3d532008c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluatorTest.java index d4a222a751..4208c7070f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluatorTest.java index de3d20696e..674364710b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluatorTest.java @@ -1,19 +1,16 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.evaluator; import java.util.Arrays; +import java.util.Collections; import java.util.List; import org.junit.Assert; @@ -38,6 +35,7 @@ import org.openmrs.module.reporting.query.visit.VisitIdSet; import org.openmrs.test.BaseContextSensitiveTest; import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; import org.openmrs.util.OpenmrsConstants; import org.springframework.beans.factory.annotation.Autowired; @@ -70,7 +68,6 @@ public class OrderForVisitDataEvaluatorTest extends BaseModuleContextSensitiveTe */ @Before public void setup() throws Exception { - if (ModuleUtil.compareVersion(OpenmrsConstants.OPENMRS_VERSION, "1.10") < 0) { setup1_9(); } else { @@ -121,6 +118,7 @@ private void setup1_10() throws Exception { */ @Test public void evaluate_shouldReturnAllOrdersForAVisit() throws Exception { + OrderType orderType = orderService.getOrderType(1); VisitEvaluationContext context = new VisitEvaluationContext(); context.setBaseVisits(new VisitIdSet(1)); @@ -144,7 +142,7 @@ public void evaluate_shouldFilterByType() throws Exception { OrderForVisitDataDefinition d = new OrderForVisitDataDefinition(); - d.setTypes(Arrays.asList(orderService.getOrderType(1))); + d.setTypes(Collections.singletonList(orderService.getOrderType(1))); EvaluatedVisitData vd = Context.getService(VisitDataService.class).evaluate(d, context); Assert.assertEquals(expectedOrdersWithType.intValue(), ((List) vd.getData().get(1)).size()); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluatorTest.java index b05285d06c..94aee19532 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluatorTest.java index 23919796e9..c46eb67e98 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluatorTest.java index e4baf10fc7..8b6ff32f17 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import static org.hamcrest.core.Is.is; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java index c9dbab89b3..f5815de1a0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluatorTest.java @@ -1,8 +1,17 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.Cohort; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.common.TestUtil; @@ -12,9 +21,11 @@ import org.openmrs.module.reporting.evaluation.EvaluationContext; import org.openmrs.module.reporting.evaluation.context.VisitEvaluationContext; import org.openmrs.module.reporting.query.visit.VisitIdSet; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; -public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{ +@SkipBaseSetup +public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest { protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; @@ -26,8 +37,10 @@ public class VisitIdDataEvaluatorTest extends BaseModuleContextSensitiveTest{ * * @throws Exception */ - @Before + @BeforeEach public void setup() throws Exception { + initializeInMemoryDatabase(); + authenticate(); executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibraryTest.java index c6d6581f5b..8e4a0b7b5e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibraryTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.library; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/AnEvaluatableDataSetDefinition.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/AnEvaluatableDataSetDefinition.java index 821d14cd32..0356c5817e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/AnEvaluatableDataSetDefinition.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/AnEvaluatableDataSetDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.openmrs.module.reporting.dataset.DataSet; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortCrossTabDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortCrossTabDataSetEvaluatorTest.java index e83bc39709..22fd375df5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortCrossTabDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortCrossTabDataSetEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluatorTest.java index bdaf403346..073f4d7874 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import java.util.Date; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluatorTest.java index 3e039d4b23..85572c216b 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.hamcrest.BaseMatcher; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluatorTest.java index bd5c17cc7c..8f8b6bcdf3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluatorTest.java index ff1d720b4d..c385b959df 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluatorTest.java index 1d6acc6d56..7e3b88d661 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import static org.hamcrest.core.Is.is; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluatorTest.java index 81da12f69d..b3e425070e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluatorTest.java index b51c7e0eae..079a7b7d30 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluatorTest.java @@ -1,20 +1,20 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.openmrs.Patient; +import org.openmrs.api.PatientService; +import org.openmrs.module.reporting.common.DateUtil; import org.openmrs.module.reporting.dataset.SimpleDataSet; import org.openmrs.module.reporting.dataset.definition.MultiParameterDataSetDefinition; import org.openmrs.module.reporting.dataset.definition.SqlDataSetDefinition; @@ -38,6 +38,17 @@ public class MultiParameterDataSetEvaluatorTest extends BaseModuleContextSensiti @Autowired DataSetDefinitionService dataSetDefinitionService; + @Autowired + PatientService patientService; + + @Before + // This is needed due to a change to standardTestDataset in the OpenMRS 2.2 release that changed person 6 birth year from 2007 to 1975 + public void setup() { + Patient p = patientService.getPatient(6); + p.setBirthdate(DateUtil.getDateTime(2007, 5, 27)); + patientService.savePatient(p); + } + /** * @see {@link org.openmrs.module.reporting.dataset.definition.evaluator.MultiParameterDataSetEvaluator#evaluate(org.openmrs.module.reporting.dataset.definition.DataSetDefinition, org.openmrs.module.reporting.evaluation.EvaluationContext)} */ @@ -108,4 +119,4 @@ public void evaluate_shouldEvaluateAMultiParameterDataSetDefinition() throws Exc Assert.assertTrue(thirdDateResult.before(secondIterationParameter)); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluatorTest.java index 75196cb357..9dec6a2c12 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; @@ -23,8 +19,11 @@ import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.openmrs.Location; +import org.openmrs.Patient; +import org.openmrs.api.PatientService; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.ReportingConstants; import org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition; @@ -43,9 +42,21 @@ import org.openmrs.module.reporting.indicator.dimension.CohortIndicatorAndDimensionResult; import org.openmrs.test.BaseModuleContextSensitiveTest; import org.openmrs.test.Verifies; +import org.springframework.beans.factory.annotation.Autowired; public class MultiPeriodIndicatorDataSetEvaluatorTest extends BaseModuleContextSensitiveTest { + @Autowired + PatientService patientService; + + @Before + // This is needed due to a change to standardTestDataset in the OpenMRS 2.2 release that changed person 6 birth year from 2007 to 1975 + public void setup() { + Patient p = patientService.getPatient(6); + p.setBirthdate(DateUtil.getDateTime(2007, 5, 27)); + patientService.savePatient(p); + } + /** * @see {@link MultiPeriodIndicatorDataSetEvaluator#evaluate(DataSetDefinition,EvaluationContext)} */ @@ -98,4 +109,4 @@ public void evaluate_shouldEvaluateAMultiPeriodIndicatorDataSetDefinition() thro } } } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MySqlDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MySqlDataSetEvaluatorTest.java index 7e1f124b42..e3ea510f0f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MySqlDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/MySqlDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluatorTest.java index cfdd5587a9..cb18cdba3f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import static org.hamcrest.Matchers.containsInAnyOrder; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluatorTest.java index 3626279237..9fa2d74b51 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PersonDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PersonDataSetEvaluatorTest.java index 175a9c0a99..dc4be26c49 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PersonDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/PersonDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java index a2297d185d..c99debd6f5 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.apache.commons.lang.time.DateUtils; @@ -35,8 +30,8 @@ import java.util.HashMap; import java.util.Map; -import static org.mockito.Matchers.argThat; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -103,7 +98,7 @@ public void testEvaluate() throws Exception { // verify we delegated as expected - verify(service).evaluate(argThat(new ArgumentMatcher() { + verify(service).evaluate((DataSetDefinition) argThat(new ArgumentMatcher() { @Override public boolean matches(Object argument) { MultiParameterDataSetDefinition actualDelegate = (MultiParameterDataSetDefinition) argument; @@ -143,7 +138,7 @@ public void testEvaluateCoversWholeEndDay() throws Exception { // verify we delegated as expected - verify(service).evaluate(argThat(new ArgumentMatcher() { + verify(service).evaluate((DataSetDefinition) argThat(new ArgumentMatcher() { @Override public boolean matches(Object argument) { MultiParameterDataSetDefinition actualDelegate = (MultiParameterDataSetDefinition) argument; @@ -188,7 +183,7 @@ public void testEvaluateAddingTime() throws Exception { // verify we delegated as expected - verify(service).evaluate(argThat(new ArgumentMatcher() { + verify(service).evaluate((DataSetDefinition) argThat(new ArgumentMatcher() { @Override public boolean matches(Object argument) { MultiParameterDataSetDefinition actualDelegate = (MultiParameterDataSetDefinition) argument; @@ -243,7 +238,7 @@ public void testEvaluateWithMoreParameters() throws Exception { // verify we delegated as expected - verify(service).evaluate(argThat(new ArgumentMatcher() { + verify(service).evaluate((DataSetDefinition) argThat(new ArgumentMatcher() { @Override public boolean matches(Object argument) { MultiParameterDataSetDefinition actualDelegate = (MultiParameterDataSetDefinition) argument; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluatorTest.java index 16b5a68b4c..e9d2ebe15d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluatorTest.java index 202cf92f0a..6e6c42217f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluatorTest.java new file mode 100644 index 0000000000..1b28c16b2b --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluatorTest.java @@ -0,0 +1,96 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.dataset.definition.evaluator; + +import org.hibernate.cfg.Environment; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openmrs.PersonAttributeType; +import org.openmrs.api.PersonService; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.common.DateUtil; +import org.openmrs.module.reporting.common.TestUtil; +import org.openmrs.module.reporting.dataset.DataSetRow; +import org.openmrs.module.reporting.dataset.SimpleDataSet; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.SqlFileDataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Properties; + +@SkipBaseSetup +public class SqlFileDataSetEvaluatorTest extends BaseModuleContextSensitiveTest { + + protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; + + protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset"; + + @Autowired + PersonService personService; + + @Before + public void setup() throws Exception { + initializeInMemoryDatabase(); + executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); + authenticate(); + getConnection().commit(); + } + + @Override + public Properties getRuntimeProperties() { + Properties p = super.getRuntimeProperties(); + p.put("connection.url", p.getProperty(Environment.URL)); + p.put(Environment.URL, p.getProperty(Environment.URL) + ";MVCC=TRUE"); + p.put("connection.driver_class", p.getProperty(Environment.DRIVER)); + return p; + } + + /** + * @see {@link SqlDataSetEvaluator#evaluate(DataSetDefinition,EvaluationContext)} + */ + @Test + public void evaluate_shouldEvaluateSqlResource() throws Exception { + SqlFileDataSetDefinition d = new SqlFileDataSetDefinition(); + d.setSqlResource("org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileNoParams.sql"); + SimpleDataSet result = (SimpleDataSet) Context.getService(DataSetDefinitionService.class).evaluate(d, null); + Assert.assertEquals(1, result.getRows().size()); + Assert.assertEquals(3, result.getMetaData().getColumnCount()); + DataSetRow firstRow = result.getRows().get(0); + Assert.assertEquals(2, firstRow.getColumnValue("patient_id")); + Assert.assertEquals("M", firstRow.getColumnValue("gender")); + Assert.assertEquals(DateUtil.getDateTime(1975, 4, 8), firstRow.getColumnValue("birthdate")); + } + + /** + * @see {@link SqlDataSetEvaluator#evaluate(DataSetDefinition,EvaluationContext)} + */ + @Test + public void evaluate_shouldEvaluateSqlResourceWithParams() throws Exception { + SqlFileDataSetDefinition d = new SqlFileDataSetDefinition(); + d.setSqlResource("org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileWithParams.sql"); + d.addParameter(new Parameter("birthplace", "birthplace", PersonAttributeType.class)); + + EvaluationContext context = new EvaluationContext(); + context.addParameterValue("birthplace", personService.getPersonAttributeTypeByName("Birthplace")); + + SimpleDataSet result = (SimpleDataSet) Context.getService(DataSetDefinitionService.class).evaluate(d, context); + Assert.assertEquals(4, result.getRows().size()); + Assert.assertEquals(4, result.getMetaData().getColumnCount()); + DataSetRow firstRow = result.getRows().get(0); + Assert.assertEquals(2, firstRow.getColumnValue("patient_id")); + Assert.assertEquals("Mooresville, NC", firstRow.getColumnValue("birthplace")); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluatorTest.java index f49e118d56..fc894892b1 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluatorTest.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverterTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverterTest.java index e5bee05518..6b19801eea 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverterTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverterTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.converter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibrariesComponentTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibrariesComponentTest.java index bbe0ce82d6..12a1a80048 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibrariesComponentTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibrariesComponentTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibraryTest.java index 8064dcd256..3eb71bc779 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibraryTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredLibraryTest.java new file mode 100644 index 0000000000..9b8b1008e4 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredLibraryTest.java @@ -0,0 +1,41 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.definition.library.implementerconfigured; + +import org.openmrs.module.reporting.report.util.ReportUtil; +import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.util.OpenmrsUtil; + +import java.io.File; + +public abstract class BaseImplementerConfiguredLibraryTest extends BaseModuleContextSensitiveTest { + + protected File baseDir; + + protected void copyResource(String type, String name) throws Exception { + String sqlQuery = getContents(type, name); + ReportUtil.writeStringToFile(new File(getConfigDir(type), name), sqlQuery); + } + + protected String getContents(String type, String name) { + return ReportUtil.readStringFromResource("implementerconfigured/" + type + "/" + name).trim(); + } + + protected File getConfigDir(String type) { + if (baseDir == null) { + baseDir = new File(OpenmrsUtil.getApplicationDataDirectory(), BaseImplementerConfiguredDefinitionLibrary.BASE_DIR); + } + File configDir = new File(baseDir, type); + if (!configDir.exists()) { + configDir.mkdirs(); + } + return configDir; + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibraryTest.java index 92de2eed94..e44ab8e040 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibraryTest.java @@ -1,99 +1,61 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.io.File; - import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.openmrs.api.SerializationService; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.cohort.definition.EvaluatableCohortDefinition; import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; import org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition; -import org.openmrs.module.reporting.serializer.ReportingSerializer; -import org.openmrs.util.OpenmrsUtil; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; - -@RunWith(PowerMockRunner.class) -@PrepareForTest(OpenmrsUtil.class) -public class ImplementerConfiguredCohortDefinitionLibraryTest { +import org.springframework.beans.factory.annotation.Autowired; - public static final String SQL_QUERY = "select person_id from person where gender = 'F'"; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; - private File directory; +public class ImplementerConfiguredCohortDefinitionLibraryTest extends BaseImplementerConfiguredLibraryTest { - private ImplementerConfiguredCohortDefinitionLibrary library; + @Autowired + ImplementerConfiguredCohortDefinitionLibrary library; @Before public void setUp() throws Exception { - directory = mock(File.class); - when(directory.exists()).thenReturn(true); - when(directory.isDirectory()).thenReturn(true); - - library = new ImplementerConfiguredCohortDefinitionLibrary(); - library.setDirectory(directory); + copyResource("cohort", "femalesSql.sql"); + copyResource("cohort", "femalesXml.reportingserializerxml"); + copyResource("cohort", "femalesGroovy.groovy"); + library.setDirectory(getConfigDir("cohort")); + library.loadDefinitions(); } @Test public void testSqlDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("females.sql") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn(SQL_QUERY); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.cohort.females")); - - CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.females"); + CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.femalesSql"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(SqlCohortDefinition.class)); - assertThat(((SqlCohortDefinition) definition).getQuery(), is(SQL_QUERY)); + assertThat(((SqlCohortDefinition) definition).getQuery().trim(), is("select person_id from person where gender = 'F'")); } @Test public void testSerializedDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("females.reportingserializerxml") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn( - "" - + "true" - + ""); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.cohort.females")); - - CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.females"); + CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.femalesXml"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(GenderCohortDefinition.class)); assertThat(((GenderCohortDefinition) definition).getFemaleIncluded(), is(true)); } @Test public void testGroovyDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("females.groovy") }); - library.setAutowireCapableBeanFactory(mock(AutowireCapableBeanFactory.class)); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.cohort.females")); - - CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.females"); - assertThat(definition, instanceOf(GenderCohortDefinition.class)); - assertThat(definition.getClass().getName(), is("FemalesCohortDefinition")); + CohortDefinition definition = library.getDefinition("configuration.definitionlibrary.cohort.femalesGroovy"); + assertThat(definition, notNullValue()); + assertThat(definition, instanceOf(EvaluatableCohortDefinition.class)); } - - @Test(expected = ClassCastException.class) - public void testInvalidGroovyDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("invalidCohortDefinition.groovy") }); - library.setAutowireCapableBeanFactory(mock(AutowireCapableBeanFactory.class)); - library.getDefinitionSummaries(); - } - -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryComponentTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryComponentTest.java deleted file mode 100644 index 11d444da31..0000000000 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryComponentTest.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openmrs.module.reporting.definition.library.implementerconfigured; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.InputStream; -import java.io.PrintWriter; -import java.net.URL; - -import org.hamcrest.core.Is; -import org.junit.Before; -import org.junit.Test; -import org.openmrs.module.reporting.dataset.DataSet; -import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; -import org.openmrs.module.reporting.dataset.definition.EvaluatableDataSetDefinition; -import org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService; -import org.openmrs.module.reporting.evaluation.EvaluationContext; -import org.openmrs.test.BaseModuleContextSensitiveTest; -import org.openmrs.util.OpenmrsUtil; -import org.springframework.beans.factory.annotation.Autowired; - -public class ImplementerConfiguredDataSetDefinitionLibraryComponentTest extends BaseModuleContextSensitiveTest { - - @Autowired - DataSetDefinitionService service; - - @Autowired - ImplementerConfiguredDataSetDefinitionLibrary library; - - @Before - public void setUp() throws Exception { - File dir = new File(getClass().getClassLoader().getResource("implementerconfigured/dataSet.groovy").toURI() - .getPath()).getParentFile(); - library.setDirectory(dir); - } - - @Test - public void testGroovyWithAutowired() throws Exception { - DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.dataSet"); - DataSet dataSet = service.evaluate(definition, new EvaluationContext()); - assertThat(dataSet.getMetaData().getColumnCount(), is(1)); - assertThat(dataSet.iterator().next().getColumnValue("groovy"), Is.is("Xanadu")); - } -} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryTest.java index 7dac0fe1db..efc621e9a6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibraryTest.java @@ -1,78 +1,60 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.io.File; - import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.openmrs.module.reporting.data.visit.definition.SqlVisitDataDefinition; -import org.openmrs.module.reporting.data.visit.definition.VisitDataDefinition; -import org.openmrs.module.reporting.data.visit.definition.VisitIdDataDefinition; import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.EvaluatableDataSetDefinition; import org.openmrs.module.reporting.dataset.definition.SqlDataSetDefinition; -import org.openmrs.util.OpenmrsUtil; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.beans.factory.annotation.Autowired; -@RunWith(PowerMockRunner.class) -@PrepareForTest(OpenmrsUtil.class) -public class ImplementerConfiguredDataSetDefinitionLibraryTest { - - public static final String SQL_QUERY = "select patient_id from patient"; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; - private File directory; +public class ImplementerConfiguredDataSetDefinitionLibraryTest extends BaseImplementerConfiguredLibraryTest { - private ImplementerConfiguredDataSetDefinitionLibrary library; + @Autowired + ImplementerConfiguredDataSetDefinitionLibrary library; @Before public void setUp() throws Exception { - directory = mock(File.class); - when(directory.exists()).thenReturn(true); - when(directory.isDirectory()).thenReturn(true); - - library = new ImplementerConfiguredDataSetDefinitionLibrary(); - library.setDirectory(directory); + copyResource("dataset", "patientIdSql.sql"); + copyResource("dataset", "patientIdXml.reportingserializerxml"); + copyResource("dataset", "testGroovy.groovy"); + library.setDirectory(getConfigDir("dataset")); + library.loadDefinitions(); } @Test public void testSqlDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.sql") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn(SQL_QUERY); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.dataset.patientId")); - - DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.patientId"); + DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.patientIdSql"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(SqlDataSetDefinition.class)); - assertThat(((SqlDataSetDefinition) definition).getSqlQuery(), is(SQL_QUERY)); + assertThat(((SqlDataSetDefinition) definition).getSqlQuery().trim(), is("select patient_id from patient")); } @Test public void testSerializedDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.reportingserializerxml") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))). - thenReturn("" + - "" + - "select patient_id from patient" + - ""); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.dataset.patientId")); - - DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.patientId"); - assertThat(definition, instanceOf(DataSetDefinition.class)); + DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.patientIdXml"); + assertThat(definition, notNullValue()); + assertThat(definition, instanceOf(SqlDataSetDefinition.class)); + assertThat(((SqlDataSetDefinition) definition).getSqlQuery().trim(), is("select patient_id from patient")); } + @Test + public void testGroovyDefinition() throws Exception { + DataSetDefinition definition = library.getDefinition("configuration.definitionlibrary.dataset.testGroovy"); + assertThat(definition, notNullValue()); + assertThat(definition, instanceOf(EvaluatableDataSetDefinition.class)); + } } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibraryTest.java index c8745e20d4..e947620a11 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibraryTest.java @@ -1,76 +1,52 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.io.File; - import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; import org.openmrs.module.reporting.data.encounter.definition.EncounterDataDefinition; import org.openmrs.module.reporting.data.encounter.definition.EncounterDatetimeDataDefinition; import org.openmrs.module.reporting.data.encounter.definition.SqlEncounterDataDefinition; -import org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition; -import org.openmrs.module.reporting.data.patient.definition.PatientIdDataDefinition; -import org.openmrs.module.reporting.data.patient.definition.SqlPatientDataDefinition; -import org.openmrs.util.OpenmrsUtil; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.beans.factory.annotation.Autowired; -@RunWith(PowerMockRunner.class) -@PrepareForTest(OpenmrsUtil.class) -public class ImplementerConfiguredEncounterDataDefinitionLibraryTest { - - public static final String SQL_QUERY = "select encounter_id, patient_id from encounter"; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; - private File directory; +public class ImplementerConfiguredEncounterDataDefinitionLibraryTest extends BaseImplementerConfiguredLibraryTest { - private ImplementerConfiguredEncounterDataDefinitionLibrary library; + @Autowired + ImplementerConfiguredEncounterDataDefinitionLibrary library; @Before public void setUp() throws Exception { - directory = mock(File.class); - when(directory.exists()).thenReturn(true); - when(directory.isDirectory()).thenReturn(true); - - library = new ImplementerConfiguredEncounterDataDefinitionLibrary(); - library.setDirectory(directory); + copyResource("encounterData", "patientIdSql.sql"); + copyResource("encounterData", "encounterDatetimeXml.reportingserializerxml"); + library.setDirectory(getConfigDir("encounterData")); + library.loadDefinitions(); } @Test public void testSqlDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.sql") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn(SQL_QUERY); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.encounterData.patientId")); - - EncounterDataDefinition definition = library.getDefinition("configuration.definitionlibrary.encounterData.patientId"); + EncounterDataDefinition definition = library.getDefinition("configuration.definitionlibrary.encounterData.patientIdSql"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(SqlEncounterDataDefinition.class)); - assertThat(((SqlEncounterDataDefinition) definition).getSql(), is(SQL_QUERY)); + assertThat(((SqlEncounterDataDefinition) definition).getSql().trim(), is("select encounter_id, patient_id from encounter")); } @Test public void testSerializedDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("encounterDatetime.reportingserializerxml") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))). - thenReturn(""); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.encounterData.encounterDatetime")); - - EncounterDataDefinition definition = library.getDefinition("configuration.definitionlibrary.encounterData.encounterDatetime"); + EncounterDataDefinition definition = library.getDefinition("configuration.definitionlibrary.encounterData.encounterDatetimeXml"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(EncounterDatetimeDataDefinition.class)); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibraryTest.java index d64d6c32c0..8f7ff52728 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibraryTest.java @@ -1,78 +1,52 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.io.File; - import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.openmrs.api.SerializationService; -import org.openmrs.module.reporting.cohort.definition.CohortDefinition; -import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; -import org.openmrs.module.reporting.cohort.definition.SqlCohortDefinition; import org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition; import org.openmrs.module.reporting.data.patient.definition.PatientIdDataDefinition; import org.openmrs.module.reporting.data.patient.definition.SqlPatientDataDefinition; -import org.openmrs.module.reporting.serializer.ReportingSerializer; -import org.openmrs.util.OpenmrsUtil; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.beans.factory.annotation.Autowired; -@RunWith(PowerMockRunner.class) -@PrepareForTest(OpenmrsUtil.class) -public class ImplementerConfiguredPatientDataDefinitionLibraryTest { - - public static final String SQL_QUERY = "select patient_id, patient_id from patient"; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; - private File directory; +public class ImplementerConfiguredPatientDataDefinitionLibraryTest extends BaseImplementerConfiguredLibraryTest { - private ImplementerConfiguredPatientDataDefinitionLibrary library; + @Autowired + ImplementerConfiguredPatientDataDefinitionLibrary library; @Before public void setUp() throws Exception { - directory = mock(File.class); - when(directory.exists()).thenReturn(true); - when(directory.isDirectory()).thenReturn(true); - - library = new ImplementerConfiguredPatientDataDefinitionLibrary(); - library.setDirectory(directory); + copyResource("patientData", "patientIdSql.sql"); + copyResource("patientData", "patientIdXml.reportingserializerxml"); + library.setDirectory(getConfigDir("patientData")); + library.loadDefinitions(); } @Test public void testSqlDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.sql") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn(SQL_QUERY); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.patientData.patientId")); - - PatientDataDefinition definition = library.getDefinition("configuration.definitionlibrary.patientData.patientId"); + PatientDataDefinition definition = library.getDefinition("configuration.definitionlibrary.patientData.patientIdSql"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(SqlPatientDataDefinition.class)); - assertThat(((SqlPatientDataDefinition) definition).getSql(), is(SQL_QUERY)); + assertThat(((SqlPatientDataDefinition) definition).getSql().trim(), is("select patient_id, patient_id from patient")); } @Test public void testSerializedDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.reportingserializerxml") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))). - thenReturn(""); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.patientData.patientId")); - - PatientDataDefinition definition = library.getDefinition("configuration.definitionlibrary.patientData.patientId"); + PatientDataDefinition definition = library.getDefinition("configuration.definitionlibrary.patientData.patientIdXml"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(PatientIdDataDefinition.class)); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibraryTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibraryTest.java index 3d4843ceb1..0d874a81f6 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibraryTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibraryTest.java @@ -1,76 +1,51 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.powermock.api.mockito.PowerMockito.mockStatic; -import static org.powermock.api.mockito.PowerMockito.when; - -import java.io.File; - import org.junit.Before; import org.junit.Test; -import org.junit.runner.RunWith; -import org.openmrs.module.reporting.data.encounter.definition.EncounterDataDefinition; -import org.openmrs.module.reporting.data.encounter.definition.EncounterDatetimeDataDefinition; -import org.openmrs.module.reporting.data.encounter.definition.SqlEncounterDataDefinition; import org.openmrs.module.reporting.data.visit.definition.SqlVisitDataDefinition; import org.openmrs.module.reporting.data.visit.definition.VisitDataDefinition; import org.openmrs.module.reporting.data.visit.definition.VisitIdDataDefinition; -import org.openmrs.util.OpenmrsUtil; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.springframework.beans.factory.annotation.Autowired; -@RunWith(PowerMockRunner.class) -@PrepareForTest(OpenmrsUtil.class) -public class ImplementerConfiguredVisitDataDefinitionLibraryTest { - - public static final String SQL_QUERY = "select visit_id, patient_id from visit"; +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; - private File directory; +public class ImplementerConfiguredVisitDataDefinitionLibraryTest extends BaseImplementerConfiguredLibraryTest { - private ImplementerConfiguredVisitDataDefinitionLibrary library; + @Autowired + ImplementerConfiguredVisitDataDefinitionLibrary library; @Before public void setUp() throws Exception { - directory = mock(File.class); - when(directory.exists()).thenReturn(true); - when(directory.isDirectory()).thenReturn(true); - - library = new ImplementerConfiguredVisitDataDefinitionLibrary(); - library.setDirectory(directory); + copyResource("visitData", "patientIdSql.sql"); + copyResource("visitData", "visitIdXml.reportingserializerxml"); + library.setDirectory(getConfigDir("visitData")); + library.loadDefinitions(); } @Test public void testSqlDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("patientId.sql") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))).thenReturn(SQL_QUERY); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.visitData.patientId")); - - VisitDataDefinition definition = library.getDefinition("configuration.definitionlibrary.visitData.patientId"); + VisitDataDefinition definition = library.getDefinition("configuration.definitionlibrary.visitData.patientIdSql"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(SqlVisitDataDefinition.class)); - assertThat(((SqlVisitDataDefinition) definition).getSql(), is(SQL_QUERY)); + assertThat(((SqlVisitDataDefinition) definition).getSql().trim(), is("select visit_id, patient_id from visit")); } @Test public void testSerializedDefinition() throws Exception { - when(directory.listFiles()).thenReturn(new File[] { new File("visitId.reportingserializerxml") }); - - mockStatic(OpenmrsUtil.class); - when(OpenmrsUtil.getFileAsString(any(File.class))). - thenReturn(""); - - assertThat(library.getDefinitionSummaries().size(), is(1)); - assertThat(library.getDefinitionSummaries().get(0).getKey(), is("configuration.definitionlibrary.visitData.visitId")); - - VisitDataDefinition definition = library.getDefinition("configuration.definitionlibrary.visitData.visitId"); + VisitDataDefinition definition = library.getDefinition("configuration.definitionlibrary.visitData.visitIdXml"); + assertThat(definition, notNullValue()); assertThat(definition, instanceOf(VisitIdDataDefinition.class)); } - } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/definition/service/DefinitionServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/definition/service/DefinitionServiceTest.java index 5340408c20..993641f0c8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/definition/service/DefinitionServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/definition/service/DefinitionServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.service; import static org.hamcrest.Matchers.empty; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/CachingCohortDefinitionTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/CachingCohortDefinitionTest.java index 97e54ea0d4..7eaa093abc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/CachingCohortDefinitionTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/CachingCohortDefinitionTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationContextTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationContextTest.java index 1e08d029fe..562782eee4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationContextTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationContextTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java index 33f8baae2f..786c3fa0c3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.evaluation; import org.apache.log4j.Appender; @@ -20,15 +15,18 @@ import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.apache.log4j.WriterAppender; -import org.junit.After; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; import org.openmrs.module.reporting.indicator.CohortIndicator; import org.openmrs.module.reporting.indicator.service.IndicatorService; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.module.reporting.test.OpenmrsVersionTestListener; +import org.openmrs.module.reporting.test.RequiresVersion; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; +import org.springframework.test.context.TestExecutionListeners; import java.io.StringWriter; import java.util.ArrayList; @@ -38,6 +36,8 @@ /** * Tests for {@link EvaluationProfiler} */ +@TestExecutionListeners(OpenmrsVersionTestListener.class) +@RequiresVersion("1.* - 2.3.*") public class EvaluationProfilerTest extends BaseModuleContextSensitiveTest { protected EvaluationProfiler profiler1, profiler2; @@ -50,7 +50,7 @@ public class EvaluationProfilerTest extends BaseModuleContextSensitiveTest { /** * Setup each test by configuring AOP on the relevant services and logging for the profiler class */ - @Before + @BeforeEach public void setup() { profiler1 = new EvaluationProfiler(new EvaluationContext()); profiler2 = new EvaluationProfiler(new EvaluationContext()); @@ -68,7 +68,7 @@ public void setup() { /** * Cleanup after tests by removing AOP and resetting logging */ - @After + @AfterEach public void cleanup() { logger.setLevel(startingLevel); for (Appender appender : startingAppenders) { @@ -96,4 +96,4 @@ public void integration() throws EvaluationException { Assert.assertTrue(split[2].contains("GenderCohortDefinition[males]")); Assert.assertTrue(split[5].contains("EVALUATION_COMPLETED")); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java new file mode 100644 index 0000000000..a4edf82f44 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/EvaluationProfilerTest24On.java @@ -0,0 +1,98 @@ +package org.openmrs.module.reporting.evaluation; + +import java.util.List; + +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.config.AppenderRef; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.LoggerConfig; +import org.apache.logging.log4j.core.layout.PatternLayout; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openmrs.api.context.Context; +import org.openmrs.logging.MemoryAppender; +import org.openmrs.logging.OpenmrsLoggingUtil; +import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; +import org.openmrs.module.reporting.indicator.CohortIndicator; +import org.openmrs.module.reporting.indicator.service.IndicatorService; +import org.openmrs.module.reporting.test.OpenmrsVersionTestListener; +import org.openmrs.module.reporting.test.RequiresVersion; +import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.util.OpenmrsUtil; +import org.springframework.test.context.TestExecutionListeners; + +/** + * Tests for {@link EvaluationProfiler} + */ +@TestExecutionListeners(OpenmrsVersionTestListener.class) +@RequiresVersion("2.4.* - 2.*") +public class EvaluationProfilerTest24On extends BaseModuleContextSensitiveTest { + + protected EvaluationProfiler profiler1, profiler2; + + private static MemoryAppender appender; + + @BeforeClass + public static void beforeClass() { + appender = OpenmrsLoggingUtil.getMemoryAppender(); + + if (appender == null) { + LoggerContext context = (LoggerContext) LogManager.getContext(false); + Configuration config = context.getConfiguration(); + + appender = MemoryAppender.newBuilder().setName("MEMORY_APPENDER").setLayout(PatternLayout.createDefaultLayout()) + .setConfiguration(config).build(); + appender.start(); + + config.addAppender(appender); + + AppenderRef appenderRef = AppenderRef.createAppenderRef("MEMORY_APPENDER", Level.ALL, null); + LoggerConfig loggerConfig = LoggerConfig.createLogger(false, Level.ALL, EvaluationProfiler.class.getName(), null, + new AppenderRef[] { appenderRef }, null, config, null); + loggerConfig.addAppender(appender, Level.ALL, null); + config.addLogger(EvaluationProfiler.class.getName(), loggerConfig); + context.updateLoggers(); + } + + } + + @AfterClass + public static void afterClass() { + ((LoggerContext) LogManager.getContext()).updateLoggers(); + } + + /** + * Setup each test by configuring AOP on the relevant services and logging for the profiler class + */ + @Before + public void setup() { + profiler1 = new EvaluationProfiler(new EvaluationContext()); + profiler2 = new EvaluationProfiler(new EvaluationContext()); + } + + @Test + public void integration() throws EvaluationException { + GenderCohortDefinition males = new GenderCohortDefinition(); + males.setName("males"); + males.setMaleIncluded(true); + + CohortIndicator count = new CohortIndicator(); // No name, log message should use "?" + count.setCohortDefinition(males, ""); + + Context.getService(IndicatorService.class).evaluate(count, null); + + List split = appender.getLogLines(); + Assert.assertEquals(6, split.size()); + Assert.assertTrue(split.get(0).contains("EVALUATION_STARTED")); + Assert.assertTrue(split.get(1).contains(">")); + Assert.assertTrue(split.get(1).contains("CohortIndicator")); + Assert.assertTrue(split.get(2).contains(">>")); + Assert.assertTrue(split.get(2).contains("GenderCohortDefinition[males]")); + Assert.assertTrue(split.get(5).contains("EVALUATION_COMPLETED")); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/parameter/ParameterUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/parameter/ParameterUtilTest.java index f0755842c6..5a3f3a03cb 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/parameter/ParameterUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/parameter/ParameterUtilTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.parameter; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilderTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilderTest.java index 8770acff9e..058b3f9cfc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilderTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilderTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.querybuilder; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/SqlQueryBuilderTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/SqlQueryBuilderTest.java index e7e1c7ce43..7bd145eab1 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/SqlQueryBuilderTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/querybuilder/SqlQueryBuilderTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.querybuilder; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceTest.java index e9dce1894d..6fae1d5b33 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.evaluation.service; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/CohortIndicatorDataSetEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/CohortIndicatorDataSetEvaluatorTest.java index c997dab78f..01188ea49d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/CohortIndicatorDataSetEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/CohortIndicatorDataSetEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator; import java.util.Collections; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/PeriodIndicatorReportTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/PeriodIndicatorReportTest.java index 950024fdb7..56d776cd07 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/PeriodIndicatorReportTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/PeriodIndicatorReportTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/QueryCountIndicatorEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/QueryCountIndicatorEvaluatorTest.java index 62bc43a256..f528157aab 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/QueryCountIndicatorEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/QueryCountIndicatorEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/SqlIndicatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/SqlIndicatorTest.java index 9d6b5a6d20..b0374f0443 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/SqlIndicatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/SqlIndicatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/aggregation/AggregationTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/aggregation/AggregationTest.java index c35f8751a8..2836bfdb9e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/aggregation/AggregationTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/aggregation/AggregationTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.aggregation; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/util/IndicatorUtilTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/util/IndicatorUtilTest.java index 500a83b8fc..b8f3da7fdb 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/indicator/util/IndicatorUtilTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/indicator/util/IndicatorUtilTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.util; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/logic/GenderRule.java b/api-tests/src/test/java/org/openmrs/module/reporting/logic/GenderRule.java index 8f9732faad..2b478f1990 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/logic/GenderRule.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/logic/GenderRule.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.logic; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicContext.java b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicContext.java index 46303d4001..bf9c84e1de 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicContext.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.logic; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicCriteria.java b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicCriteria.java index 44a4ca0520..2a2b810e63 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicCriteria.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicCriteria.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.logic; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicService.java b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicService.java index 7c00485b66..b4edacf9a7 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicService.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/logic/MockLogicService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.logic; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluatorTest.java index e0ea0e4dc2..43e8f85e4c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluatorTest.java index 3bdc0bc919..bc72ceafc2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluatorTest.java index 93f3ce9444..0540a2fa7e 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluatorTest.java index cd65a44fa5..17e1e6032c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; import org.apache.commons.logging.Log; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluatorTest.java index 0b182617f1..0a33358472 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java index 82f0232d56..d50fce7ca2 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersObsQueryEvaluatorTest.java @@ -1,7 +1,16 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.common.DateUtil; import org.openmrs.module.reporting.common.TestUtil; @@ -11,7 +20,8 @@ import org.openmrs.module.reporting.query.obs.definition.BasicObsQuery; import org.openmrs.module.reporting.query.obs.definition.MappedParametersObsQuery; import org.openmrs.module.reporting.query.obs.service.ObsQueryService; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; import java.util.Date; import java.util.HashMap; @@ -21,14 +31,17 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; +@SkipBaseSetup public class MappedParametersObsQueryEvaluatorTest extends BaseModuleContextSensitiveTest { protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; protected static final String XML_REPORT_TEST_DATASET = "ReportTestDataset"; - @Before + @BeforeEach public void setup() throws Exception { + initializeInMemoryDatabase(); + authenticate(); executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluatorTest.java index 0280273f41..ed29b899c0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluatorTest.java index 1df07c4f8a..0b99cec1c4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluatorTest.java index 95075273e6..70a426410a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImplTest.java index 5d5dd238cb..e92c7cffa8 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluatorTest.java index 4ce4971606..1e69dc38d3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluatorTest.java index 53c7a2d1be..b2f47f881c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.evaluator; import org.junit.Before; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java index 5522646b4e..783385ad97 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluatorTest.java @@ -1,23 +1,19 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.evaluator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.Cohort; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.common.TestUtil; @@ -27,17 +23,21 @@ import org.openmrs.module.reporting.query.obs.ObsQueryResult; import org.openmrs.module.reporting.query.obs.definition.SqlObsQuery; import org.openmrs.module.reporting.query.obs.service.ObsQueryService; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; /** * Test the evaluation of the SqlObsQuery */ +@SkipBaseSetup public class SqlObsQueryEvaluatorTest extends BaseModuleContextSensitiveTest { protected static Log log = LogFactory.getLog(SqlObsQueryEvaluatorTest.class); - @Before + @BeforeEach public void setup() throws Exception { + initializeInMemoryDatabase(); + authenticate(); executeDataSet("org/openmrs/module/reporting/include/" + new TestUtil().getTestDatasetFilename("ReportTestDataset")); } diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImplTest.java index 497517e47a..9355ea9521 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluatorTest.java index 9356567f82..d7589052ba 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluatorTest.java index 941b7755ee..cec3431b9a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.person.evaluator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluatorTest.java index b9b6287e8c..bda0e35b02 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluatorTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImplTest.java index dc64330d6a..9977db9bbb 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java index 8d13a74e28..1f7f83f632 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluatorTest.java @@ -1,7 +1,16 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit.evaluator; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.openmrs.Patient; import org.openmrs.Visit; import org.openmrs.api.VisitService; @@ -13,7 +22,8 @@ import org.openmrs.module.reporting.query.visit.VisitQueryResult; import org.openmrs.module.reporting.query.visit.definition.ActiveVisitQuery; import org.openmrs.module.reporting.query.visit.service.VisitQueryService; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.test.SkipBaseSetup; +import org.openmrs.test.jupiter.BaseModuleContextSensitiveTest; import org.springframework.beans.factory.annotation.Autowired; import java.util.ArrayList; @@ -23,6 +33,7 @@ import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; import static org.junit.Assert.assertThat; +@SkipBaseSetup public class ActiveVisitQueryEvaluatorTest extends BaseModuleContextSensitiveTest { protected static final String XML_DATASET_PATH = "org/openmrs/module/reporting/include/"; @@ -38,8 +49,10 @@ public class ActiveVisitQueryEvaluatorTest extends BaseModuleContextSensitiveTes @Autowired private TestDataManager data; - @Before + @BeforeEach public void setup() throws Exception { + initializeInMemoryDatabase(); + authenticate(); executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REPORT_TEST_DATASET)); } @@ -58,8 +71,8 @@ public void testEvaluate() throws Exception { activeVisits.add(5); // now we will create a couple inactive visits, and two active ones - Patient patient1 = data.randomPatient().save(); - Patient patient2 = data.randomPatient().save(); + Patient patient1 = data.randomPatient().birthdate("1975-05-27").save(); + Patient patient2 = data.randomPatient().birthdate("1975-05-27").save(); data.visit().patient(patient1).visitType(1).location(1).started("2013-04-05").stopped("2013-04-06").save(); data.visit().patient(patient2).visitType(1).location(1).started("2013-04-05").stopped("2013-04-06").save(); Visit active1 = data.visit().patient(patient1).visitType(1).location(1).started(startOfYesterday).stopped(endOfYesterday).save(); @@ -74,4 +87,4 @@ public void testEvaluate() throws Exception { assertThat(result.getMemberIds(), containsInAnyOrder(activeVisits.toArray())); } -} \ No newline at end of file +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluatorTest.java index b40265b942..41aeb43005 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluatorTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.visit.evaluator; import static org.openmrs.module.reporting.common.ReportingMatchers.hasExactlyIds; @@ -79,8 +74,8 @@ public void testEvaluate() throws Exception { activeVisits.add(5); // now we will create a couple inactive visits, and two active ones - Patient patient1 = data.randomPatient().save(); - Patient patient2 = data.randomPatient().save(); + Patient patient1 = data.randomPatient().birthdate("1975-05-27").save(); + Patient patient2 = data.randomPatient().birthdate("1975-05-27").save(); Visit inactive1 = data.visit().patient(patient1).visitType(1).location(1).started("2013-04-01").stopped("2013-04-06").save(); Visit inactive2 = data.visit().patient(patient2).visitType(1).location(1).started("2013-04-01").stopped("2013-04-15").save(); activeVisits.add(inactive1.getId()); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/ReportRequestTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/ReportRequestTest.java index 5aa4cf8dbe..d25058bb86 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/ReportRequestTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/ReportRequestTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImplTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImplTest.java index 6711035ee4..13561a3307 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImplTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImplTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition.service; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRendererTest.java index 4abf4b2c77..6d06b87a65 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRendererTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CsvReportRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CsvReportRendererTest.java index d0b02806af..b53f70156a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CsvReportRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/CsvReportRendererTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRendererTest.java index cb1e20263d..522a5b7128 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRendererTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.report.renderer; import org.apache.commons.io.IOUtils; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRendererTest.java index 54f95b9d67..18c8255ec3 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRendererTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ReportDesignRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ReportDesignRendererTest.java index 6ba5eac190..1a21c9347c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ReportDesignRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/ReportDesignRendererTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.renderer; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/TextTemplateRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/TextTemplateRendererTest.java index 1dd55b7332..02e4d21d9a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/TextTemplateRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/TextTemplateRendererTest.java @@ -1,27 +1,24 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.openmrs.Patient; +import org.openmrs.api.PatientService; import org.openmrs.api.context.Context; import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; +import org.openmrs.module.reporting.common.DateUtil; import org.openmrs.module.reporting.dataset.definition.CohortCrossTabDataSetDefinition; import org.openmrs.module.reporting.dataset.definition.SimplePatientDataSetDefinition; import org.openmrs.module.reporting.evaluation.EvaluationContext; @@ -32,12 +29,27 @@ import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; import org.openmrs.test.BaseModuleContextSensitiveTest; import org.openmrs.util.OpenmrsClassLoader; +import org.springframework.beans.factory.annotation.Autowired; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; /** * Tests the TextTemplateRenderer */ public class TextTemplateRendererTest extends BaseModuleContextSensitiveTest { - + + @Autowired + PatientService patientService; + + @Before + // This is needed due to a change to standardTestDataset in the OpenMRS 2.2 release that changed person 6 birth year from 2007 to 1975 + public void setup() { + Patient p = patientService.getPatient(6); + p.setBirthdate(DateUtil.getDateTime(2007, 5, 27)); + patientService.savePatient(p); + } + @Test public void shouldRenderVariableReplacementTemplate() throws Exception { shouldRenderTemplate("VariableReplacementTemplate.txt", null); @@ -63,15 +75,15 @@ private void shouldRenderTemplate(String templateName, String templateType) thro allPatients.addPatientProperty("gender"); allPatients.addPatientProperty("birthdate"); reportDefinition.addDataSetDefinition("allPatients", allPatients, null); - + GenderCohortDefinition males = new GenderCohortDefinition(); males.setName("Males"); males.setMaleIncluded(true); - + GenderCohortDefinition females = new GenderCohortDefinition(); females.setName("Females"); females.setFemaleIncluded(true); - + CohortCrossTabDataSetDefinition genderDsd = new CohortCrossTabDataSetDefinition(); genderDsd.addColumn("males", males, null); genderDsd.addColumn("females", females, null); diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/XlsReportRendererTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/XlsReportRendererTest.java index a91a9e4945..7caa69d197 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/XlsReportRendererTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/renderer/XlsReportRendererTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/MysqlReportServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/MysqlReportServiceTest.java index 2213c2cc4b..9f21b63574 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/MysqlReportServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/MysqlReportServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.service; import java.util.List; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/ReportServiceTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/ReportServiceTest.java index fcd2cbc5d1..1f460db5a4 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/ReportServiceTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/ReportServiceTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.service; import org.apache.commons.io.FileUtils; @@ -33,14 +42,17 @@ import java.io.File; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Properties; import java.util.UUID; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; public class ReportServiceTest extends BaseModuleContextSensitiveTest { @@ -512,4 +524,108 @@ public void purgeReportDesignsForReportDefinition_shouldDeleteAllAssociatedRepor assertNull(rs.getReportDesignByUuid("d7a82b63-1066-4c1d-9b43-b405851fc467")); assertNull(rs.getReportDesignByUuid("e7a82b63-1066-4c1d-9b43-b405851fc467")); } -} \ No newline at end of file + + @Test + public void getReportRequests_shouldReturnCorrectReportRequests() { + final ReportService rs = Context.getService(ReportService.class); + final List reportRequests = rs.getReportRequests(null, null, null, 0,2); + + assertEquals(2, reportRequests.size()); + + final List resultUuids = mapToReportRequestUuids(reportRequests); + assertTrue(resultUuids.contains("fce15a1b-4618-4f65-bfe9-8bb60a85c110")); + assertTrue(resultUuids.contains("b0a82b63-1066-4c1d-9b43-b405851fc467")); + } + + @Test + public void getReportRequestsCount_shouldReturnTotalCount() { + final ReportService rs = Context.getService(ReportService.class); + final long totalCount = rs.getReportRequestsCount(null, null, null); + + assertEquals(4, totalCount); + } + + @Test + public void getReportRequests_shouldReturnCorrectReportRequestsForGivenReportDefinition() { + final ReportService rs = Context.getService(ReportService.class); + final ReportDefinition testReportDefinition = + rs.getReportDesignByUuid("d7a82b63-1066-4c1d-9b43-b405851fc467").getReportDefinition(); + final List reportRequests = rs.getReportRequests(testReportDefinition, null, null, 0,2); + + assertEquals(2, reportRequests.size()); + + final List resultUuids = mapToReportRequestUuids(reportRequests); + assertTrue(resultUuids.contains("h8a82b63-1066-4c1d-9b43-b405851fc467")); + assertTrue(resultUuids.contains("b0a82b63-1066-4c1d-9b43-b405851fc467")); + } + + @Test + public void getReportRequestsCount_shouldReturnCorrectTotalCountForReportDefinitionFilter() { + final ReportService rs = Context.getService(ReportService.class); + final ReportDefinition testReportDefinition = + rs.getReportDesignByUuid("d7a82b63-1066-4c1d-9b43-b405851fc467").getReportDefinition(); + final long totalCount = rs.getReportRequestsCount(testReportDefinition, null, null); + + assertEquals(2, totalCount); + } + + @Test + public void getReportRequests_shouldReturnCorrectReportRequestsForRequestedWithinDates() { + final ReportService rs = Context.getService(ReportService.class); + final Date from = newDate(2013, Calendar.JANUARY, 21, 14, 8, 48); + final Date to = newDate(2013, Calendar.JANUARY, 21, 14, 8, 49); + final List reportRequests = rs.getReportRequests(null, from, to, 0,2); + + assertEquals(2, reportRequests.size()); + + final List resultUuids = mapToReportRequestUuids(reportRequests); + assertTrue(resultUuids.contains("b0a82b63-1066-4c1d-9b43-b405851fc467")); + assertTrue(resultUuids.contains("d9a82b63-1066-4c1d-9b43-b405851fc467")); + } + + @Test + public void getReportRequestsCount_shouldReturnCorrectTotalCountForRequestedWithinDatesFilter() { + final ReportService rs = Context.getService(ReportService.class); + final Date from = newDate(2013, Calendar.JANUARY, 21, 14, 8, 48); + final Date to = newDate(2013, Calendar.JANUARY, 21, 14, 8, 49); + final long totalCount = rs.getReportRequestsCount(null, from, to); + + assertEquals(2, totalCount); + } + + @Test + public void getReportRequests_shouldReturnAPartialPageOfReportRequests() { + final ReportService rs = Context.getService(ReportService.class); + final List reportRequests = rs.getReportRequests(null, null, null, 0, 2, ReportRequest.Status.FAILED); + + assertEquals(1, reportRequests.size()); + + final List resultUuids = mapToReportRequestUuids(reportRequests); + assertTrue(resultUuids.contains("fce15a1b-4618-4f65-bfe9-8bb60a85c110")); + } + + @Test + public void getReportRequestsCount_shouldReturnCorrectTotalCountForStatusFilter() { + final ReportService rs = Context.getService(ReportService.class); + final long totalCount = rs.getReportRequestsCount(null, null, null, ReportRequest.Status.FAILED); + + assertEquals(1, totalCount); + } + + private List mapToReportRequestUuids(List reportRequests) { + List reportRequestUuids = new ArrayList(); + + for (ReportRequest reportRequest : reportRequests) { + reportRequestUuids.add(reportRequest.getUuid()); + } + + return reportRequestUuids; + } + + private Date newDate(int year, int month, int day, int hour, int minute, int second) { + final Calendar cal = Calendar.getInstance(); + cal.clear(); + cal.set(year, month, day, hour, minute, second); + return cal.getTime(); + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/TestReportProcessor.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/TestReportProcessor.java index 8c5f55e3b0..dcee4f3345 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/TestReportProcessor.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/TestReportProcessor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.service; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/db/PropertiesTypeTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/db/PropertiesTypeTest.java index 68aad5b4d8..de842ac55d 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/service/db/PropertiesTypeTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/service/db/PropertiesTypeTest.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.report.service.db; import org.junit.Test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlScriptParserTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlScriptParserTest.java index 9fb2186293..c17e6ea3ec 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlScriptParserTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlScriptParserTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.util; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlUtilsTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlUtilsTest.java index a2a601f0f7..09cb8ee186 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlUtilsTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/report/util/SqlUtilsTest.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.util; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/serializer/ReportingSerializerTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/serializer/ReportingSerializerTest.java index e2fffa1ccc..7179027286 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/serializer/ReportingSerializerTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/serializer/ReportingSerializerTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/template/HandlebarsHelpersTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/template/HandlebarsHelpersTest.java index 40a884c0c7..25e50e41c0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/template/HandlebarsHelpersTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/template/HandlebarsHelpersTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.template; import com.github.jknack.handlebars.Options; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/test/AuthenticatedUserTestHelper.java b/api-tests/src/test/java/org/openmrs/module/reporting/test/AuthenticatedUserTestHelper.java index a685793cba..425dbbb7dc 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/test/AuthenticatedUserTestHelper.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/test/AuthenticatedUserTestHelper.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.test; import org.junit.After; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/test/CustomMessageSource.java b/api-tests/src/test/java/org/openmrs/module/reporting/test/CustomMessageSource.java index 3e08a8849a..7f7c2e63e0 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/test/CustomMessageSource.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/test/CustomMessageSource.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.test; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/test/OpenmrsVersionTestListener.java b/api-tests/src/test/java/org/openmrs/module/reporting/test/OpenmrsVersionTestListener.java new file mode 100644 index 0000000000..0beb820231 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/test/OpenmrsVersionTestListener.java @@ -0,0 +1,37 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.test; + +import org.apache.commons.lang3.StringUtils; +import org.junit.Assume; +import org.openmrs.module.ModuleUtil; +import org.openmrs.util.OpenmrsConstants; +import org.springframework.test.context.TestContext; +import org.springframework.test.context.support.AbstractTestExecutionListener; + +public class OpenmrsVersionTestListener extends AbstractTestExecutionListener { + + @Override + public void beforeTestClass(TestContext testContext) { + Class testClass = testContext.getTestClass(); + + RequiresVersion requiresVersionAnnotation = (RequiresVersion) testClass.getAnnotation(RequiresVersion.class); + + if (requiresVersionAnnotation == null || StringUtils.isBlank(requiresVersionAnnotation.value())) { + return; + } + + if (!ModuleUtil.matchRequiredVersions(OpenmrsConstants.OPENMRS_VERSION, + requiresVersionAnnotation.value())) { + // silly hack to work with JUnit 4.11 where the AssumptionViolationException is not exposed as a public class + Assume.assumeTrue(false); + } + } +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/test/RequiresVersion.java b/api-tests/src/test/java/org/openmrs/module/reporting/test/RequiresVersion.java new file mode 100644 index 0000000000..6bbbe6cad2 --- /dev/null +++ b/api-tests/src/test/java/org/openmrs/module/reporting/test/RequiresVersion.java @@ -0,0 +1,25 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.test; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface RequiresVersion { + + String value(); + +} diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/BaseObsCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/BaseObsCohortDefinitionValidatorTest.java index b43433e1a8..4f331898ab 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/BaseObsCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/BaseObsCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/CompositionCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/CompositionCohortDefinitionValidatorTest.java index 13e7e26f98..bb3fcf356c 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/CompositionCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/CompositionCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.HashMap; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InProgramCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InProgramCohortDefinitionValidatorTest.java index 00388a4c48..16504b11f1 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InProgramCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InProgramCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InStateCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InStateCohortDefinitionValidatorTest.java index 3bb3914962..cf0a6fe5aa 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InStateCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InStateCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InverseCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InverseCohortDefinitionValidatorTest.java index 095b8dfdf1..8488dd3a27 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/InverseCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/InverseCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/LogicCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/LogicCohortDefinitionValidatorTest.java index 9ea7113d9d..2c20eb860a 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/LogicCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/LogicCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/PatientStateCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/PatientStateCohortDefinitionValidatorTest.java index 676d4af11f..a79e2d54a7 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/PatientStateCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/PatientStateCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/ProgramEnrollmentCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/ProgramEnrollmentCohortDefinitionValidatorTest.java index 4642efe0dc..31a01e311f 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/ProgramEnrollmentCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/ProgramEnrollmentCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.ArrayList; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/SqlCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/SqlCohortDefinitionValidatorTest.java index e818937f0a..978e8b8071 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/SqlCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/SqlCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import org.junit.Assert; diff --git a/api-tests/src/test/java/org/openmrs/module/reporting/validator/StaticCohortDefinitionValidatorTest.java b/api-tests/src/test/java/org/openmrs/module/reporting/validator/StaticCohortDefinitionValidatorTest.java index 87eeb582ef..1fd0587f33 100644 --- a/api-tests/src/test/java/org/openmrs/module/reporting/validator/StaticCohortDefinitionValidatorTest.java +++ b/api-tests/src/test/java/org/openmrs/module/reporting/validator/StaticCohortDefinitionValidatorTest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import org.junit.Assert; diff --git a/api-tests/src/test/resources/TestingApplicationContext.xml b/api-tests/src/test/resources/TestingApplicationContext.xml index 956604743b..a8b7bd4391 100644 --- a/api-tests/src/test/resources/TestingApplicationContext.xml +++ b/api-tests/src/test/resources/TestingApplicationContext.xml @@ -20,10 +20,13 @@ classpath:reporting-hibernate.cfg.xml - - - + + + + org.openmrs + + diff --git a/api-tests/src/test/resources/config/sampleReport.yml b/api-tests/src/test/resources/config/sampleReport.yml new file mode 100644 index 0000000000..f8edc511e1 --- /dev/null +++ b/api-tests/src/test/resources/config/sampleReport.yml @@ -0,0 +1,46 @@ +key: "sampledataexport" +uuid: "9e7dc296-2aad-11e3-a840-5b9e0b589afb" +name: "sample.export.name" +description: "sample.export.description" +parameters: # should be able to parse comments! + - key: "startDate" + type: "date" + label: "startDate.label" + - key: "endDate" + type: "date" + label: "endDate.label" +datasets: + - key: "males" + type: "sql" + config: "persons.sql" + parameters: + - key: "gender" + value: "M" + - key: "females" + type: "sql" + config: "persons.sql" + parameters: + - key: "gender" + value: "F" + - key: "orders" + type: "sql" + config: "orders.sql" + - key: "encounters" + type: "sql" + config: "encounters.sql" +designs: + - type: "csv" + properties: + "characterEncoding": "ISO-8859-1" + "blacklistRegex": "[^\\p{InBasicLatin}\\p{L}]" + - type: "excel" + template: "ExcelTemplate.xls" +config: + includeTestPatients: "true" + categories: + - "DATA_EXPORT" + - "DAILY" + components: + - "encounters" + + diff --git a/api-tests/src/test/resources/implementerconfigured/cohort/femalesGroovy.groovy b/api-tests/src/test/resources/implementerconfigured/cohort/femalesGroovy.groovy new file mode 100644 index 0000000000..9432703162 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/cohort/femalesGroovy.groovy @@ -0,0 +1,16 @@ +package implementerconfigured.cohort + + +import org.openmrs.module.reporting.cohort.EvaluatedCohort +import org.openmrs.module.reporting.cohort.definition.EvaluatableCohortDefinition +import org.openmrs.module.reporting.evaluation.EvaluationContext + +class FemaleCohortDefinition extends EvaluatableCohortDefinition { + + @Override + EvaluatedCohort evaluate(EvaluationContext evalContext) { + def cohort = new EvaluatedCohort(this, evalContext) + return cohort + } + +} diff --git a/api-tests/src/test/resources/implementerconfigured/cohort/femalesSql.sql b/api-tests/src/test/resources/implementerconfigured/cohort/femalesSql.sql new file mode 100644 index 0000000000..1494fb6cf4 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/cohort/femalesSql.sql @@ -0,0 +1 @@ +select person_id from person where gender = 'F' diff --git a/api-tests/src/test/resources/implementerconfigured/cohort/femalesXml.reportingserializerxml b/api-tests/src/test/resources/implementerconfigured/cohort/femalesXml.reportingserializerxml new file mode 100644 index 0000000000..6735d2c8d2 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/cohort/femalesXml.reportingserializerxml @@ -0,0 +1,3 @@ + + true + diff --git a/api-tests/src/test/resources/implementerconfigured/dataset/patientIdSql.sql b/api-tests/src/test/resources/implementerconfigured/dataset/patientIdSql.sql new file mode 100644 index 0000000000..7579391f27 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/dataset/patientIdSql.sql @@ -0,0 +1 @@ +select patient_id from patient diff --git a/api-tests/src/test/resources/implementerconfigured/dataset/patientIdXml.reportingserializerxml b/api-tests/src/test/resources/implementerconfigured/dataset/patientIdXml.reportingserializerxml new file mode 100644 index 0000000000..d5b37756ed --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/dataset/patientIdXml.reportingserializerxml @@ -0,0 +1,4 @@ + + + select patient_id from patient + diff --git a/api-tests/src/test/resources/implementerconfigured/dataSet.groovy b/api-tests/src/test/resources/implementerconfigured/dataset/testGroovy.groovy similarity index 95% rename from api-tests/src/test/resources/implementerconfigured/dataSet.groovy rename to api-tests/src/test/resources/implementerconfigured/dataset/testGroovy.groovy index 7258afa64a..0835bcb498 100644 --- a/api-tests/src/test/resources/implementerconfigured/dataSet.groovy +++ b/api-tests/src/test/resources/implementerconfigured/dataset/testGroovy.groovy @@ -1,4 +1,4 @@ -package implementerconfigured +package implementerconfigured.dataset import org.openmrs.api.LocationService import org.openmrs.module.reporting.dataset.DataSet @@ -22,4 +22,4 @@ class MyDataSetDefinition extends EvaluatableDataSetDefinition { return dataSet } -} \ No newline at end of file +} diff --git a/api-tests/src/test/resources/implementerconfigured/encounterData/encounterDatetimeXml.reportingserializerxml b/api-tests/src/test/resources/implementerconfigured/encounterData/encounterDatetimeXml.reportingserializerxml new file mode 100644 index 0000000000..dac6994853 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/encounterData/encounterDatetimeXml.reportingserializerxml @@ -0,0 +1 @@ + diff --git a/api-tests/src/test/resources/implementerconfigured/encounterData/patientIdSql.sql b/api-tests/src/test/resources/implementerconfigured/encounterData/patientIdSql.sql new file mode 100644 index 0000000000..196dbf1600 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/encounterData/patientIdSql.sql @@ -0,0 +1 @@ +select encounter_id, patient_id from encounter diff --git a/api-tests/src/test/resources/implementerconfigured/patientData/patientIdSql.sql b/api-tests/src/test/resources/implementerconfigured/patientData/patientIdSql.sql new file mode 100644 index 0000000000..f29aced3ca --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/patientData/patientIdSql.sql @@ -0,0 +1 @@ +select patient_id, patient_id from patient diff --git a/api-tests/src/test/resources/implementerconfigured/patientData/patientIdXml.reportingserializerxml b/api-tests/src/test/resources/implementerconfigured/patientData/patientIdXml.reportingserializerxml new file mode 100644 index 0000000000..07e41db293 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/patientData/patientIdXml.reportingserializerxml @@ -0,0 +1 @@ + diff --git a/api-tests/src/test/resources/implementerconfigured/visitData/patientIdSql.sql b/api-tests/src/test/resources/implementerconfigured/visitData/patientIdSql.sql new file mode 100644 index 0000000000..3e3ae01f52 --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/visitData/patientIdSql.sql @@ -0,0 +1 @@ +select visit_id, patient_id from visit diff --git a/api-tests/src/test/resources/implementerconfigured/visitData/visitIdXml.reportingserializerxml b/api-tests/src/test/resources/implementerconfigured/visitData/visitIdXml.reportingserializerxml new file mode 100644 index 0000000000..422845729f --- /dev/null +++ b/api-tests/src/test/resources/implementerconfigured/visitData/visitIdXml.reportingserializerxml @@ -0,0 +1 @@ + diff --git a/api-tests/src/test/resources/log4j.xml b/api-tests/src/test/resources/log4j.xml deleted file mode 100644 index cb08faef73..0000000000 --- a/api-tests/src/test/resources/log4j.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api-tests/src/test/resources/log4j2.xml b/api-tests/src/test/resources/log4j2.xml new file mode 100644 index 0000000000..f188f4f060 --- /dev/null +++ b/api-tests/src/test/resources/log4j2.xml @@ -0,0 +1,22 @@ + + + + + %p - %C{1}.%M(%L) |%d{ISO8601}| %m%n + + + + + + + + + + + + + + + + diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileNoParams.sql b/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileNoParams.sql new file mode 100644 index 0000000000..ae2df30067 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileNoParams.sql @@ -0,0 +1,4 @@ +select t.patient_id, p.gender, p.birthdate +from patient t, person p +where t.patient_id = p.person_id +and t.patient_id = 2; diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileWithParams.sql b/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileWithParams.sql new file mode 100644 index 0000000000..a8a1a2fe79 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/dataset/definition/evaluator/sqlFileWithParams.sql @@ -0,0 +1,7 @@ +select t.patient_id, p.gender, p.birthdate, pa.value as birthplace +from patient t +inner join person p on t.patient_id = p.person_id +left join person_attribute pa on p.person_id = pa.person_id +where pa.person_attribute_type_id = @birthplace +order by t.patient_id asc +; diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ConditionCohortDefinitionEvaluatorTestDataSet.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ConditionCohortDefinitionEvaluatorTestDataSet.xml new file mode 100644 index 0000000000..c395f69bc8 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ConditionCohortDefinitionEvaluatorTestDataSet.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/DrugOrderCohortEvaluationData.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/DrugOrderCohortEvaluationData.xml new file mode 100644 index 0000000000..a0da3b8819 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/DrugOrderCohortEvaluationData.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml new file mode 100644 index 0000000000..7444951a19 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/PrivilegeTest.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-encounter-before-midnight.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-encounter-before-midnight.xml new file mode 100644 index 0000000000..d9149a17d7 --- /dev/null +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-encounter-before-midnight.xml @@ -0,0 +1,4 @@ + + + + diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.10.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.10.xml deleted file mode 100644 index 9563778ab6..0000000000 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.10.xml +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.11.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.11.xml deleted file mode 100644 index e66c1fd330..0000000000 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.11.xml +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.12.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.12.xml deleted file mode 100644 index e66c1fd330..0000000000 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.12.xml +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.9.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.9.xml deleted file mode 100644 index 434acb502a..0000000000 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-1.9.xml +++ /dev/null @@ -1,539 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.0.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.0.xml deleted file mode 100644 index 6da1c292fd..0000000000 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.0.xml +++ /dev/null @@ -1,563 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.1.xml b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.7.xml similarity index 98% rename from api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.1.xml rename to api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.7.xml index 2311993e7e..e89f14375f 100644 --- a/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.1.xml +++ b/api-tests/src/test/resources/org/openmrs/module/reporting/include/ReportTestDataset-openmrs-2.7.xml @@ -182,8 +182,8 @@ - - + + @@ -553,12 +553,22 @@ properties="#Mon Jan 21 14:08:47 CET 2013" creator="1" date_created="2013-01-21 14:08:47" retired="0" /> - - - - - - \ No newline at end of file + + + + + + + diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleEncountersReport.yml b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleEncountersReport.yml new file mode 100644 index 0000000000..2a25a1a554 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleEncountersReport.yml @@ -0,0 +1,17 @@ +key: "sampleencounters.export" +uuid: "752e386d-da67-4e3d-bddc-95157c58c54c" +name: "sample.export.encounters.name" +description: "sample.export.encounters.description" +parameters: + - key: "startDate" + type: "java.util.Date" + label: "startDate.label" + - key: "endDate" + type: "java.util.Date" + label: "endDate.label" +datasets: + - key: "encounters" + type: "sql" + config: "sql/encounters.sql" + + diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleOrdersReport.yml b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleOrdersReport.yml new file mode 100644 index 0000000000..593b607cfd --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sampleOrdersReport.yml @@ -0,0 +1,23 @@ +key: "sampleordersexport" +uuid: "9e7dc296-2aad-11e3-a840-5b9e0b589afb" +name: "sample.export.orders.name" +description: "sample.export.order.description" +parameters: + - key: "startDate" + type: "java.util.Date" + label: "startDate.label" + - key: "endDate" + type: "java.util.Date" + label: "endDate.label" +datasets: + - key: "orders" + type: "sql" + config: "sql/orders.sql" +designs: + - type: "csv" + properties: + "characterEncoding": "ISO-8859-1" + "blacklistRegex": "[^\\p{InBasicLatin}\\p{L}]" + - type: "excel" + template: "templates/SampleReportTemplate.xls" + diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/samplePersonsReport.yml b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/samplePersonsReport.yml new file mode 100644 index 0000000000..0bfe55f372 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/samplePersonsReport.yml @@ -0,0 +1,32 @@ +key: "sampleordersexport" +uuid: "0c32f660-c2de-11eb-b5a4-0242ac110002" +name: "sample.export.person.name" +description: "sample.export.person.description" +parameters: + - key: "startDate" + type: "java.util.Date" + label: "startDate.label" + - key: "endDate" + type: "java.util.Date" + label: "endDate.label" +datasets: + - key: "males" + type: "sql" + config: "sql/persons.sql" + parameters: + - key: "gender" + value: "M" + - key: "females" + type: "sql" + config: "sql/persons.sql" + parameters: + - key: "gender" + value: "F" +designs: + - type: "csv" + properties: + "characterEncoding": "ISO-8859-1" + "blacklistRegex": "[^\\p{InBasicLatin}\\p{L}]" + - type: "excel" + template: "templates/SampleReportTemplate.xls" + diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/encounters.sql b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/encounters.sql new file mode 100644 index 0000000000..be860bf709 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/encounters.sql @@ -0,0 +1 @@ +select * from encounters; diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/orders.sql b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/orders.sql new file mode 100644 index 0000000000..a9b7efe223 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/orders.sql @@ -0,0 +1 @@ +select * from orders; diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/persons.sql b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/persons.sql new file mode 100644 index 0000000000..eccba7b9b5 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/sql/persons.sql @@ -0,0 +1 @@ +select person_id, gender from person where gender = @gender; diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sampleNestedReport.yml b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sampleNestedReport.yml new file mode 100644 index 0000000000..9e2daf2ce5 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sampleNestedReport.yml @@ -0,0 +1,18 @@ +key: "samplenestedexport" +uuid: "c2fb2082-9b36-4398-96af-d20570bacd07" +name: "sample.export.nested.name" +description: "sample.export.nested.description" +parameters: + - key: "startDate" + type: "java.util.Date" + label: "startDate.label" + - key: "endDate" + type: "java.util.Date" + label: "endDate.label" +datasets: + - key: "orders" + type: "sql" + config: "sql/nested.sql" + + + diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sql/nested.sql b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sql/nested.sql new file mode 100644 index 0000000000..a9b7efe223 --- /dev/null +++ b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/subdirectory/sql/nested.sql @@ -0,0 +1 @@ +select * from orders; diff --git a/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/templates/SampleReportTemplate.xls b/api-tests/src/test/resources/testAppDataDir/configuration/reports/reportdescriptors/templates/SampleReportTemplate.xls new file mode 100644 index 0000000000..e69de29bb2 diff --git a/api/pom.xml b/api/pom.xml index dd7de992d1..a8c1c15b71 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -3,7 +3,7 @@ org.openmrs.module reporting - 1.16.0-SNAPSHOT + 2.2.0-SNAPSHOT reporting-api jar @@ -11,13 +11,4 @@ API project for Reporting - - - org.openmrs.module - reportingcompatibility-api - 1.5.8 - provided - - - diff --git a/api/src/main/java/org/openmrs/module/reporting/ExceptionUtil.java b/api/src/main/java/org/openmrs/module/reporting/ExceptionUtil.java index f8393ad4e8..68432192d7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/ExceptionUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/ExceptionUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting; diff --git a/api/src/main/java/org/openmrs/module/reporting/IllegalDatabaseAccessException.java b/api/src/main/java/org/openmrs/module/reporting/IllegalDatabaseAccessException.java index 5f606a6c3a..7adbbdcd3a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/IllegalDatabaseAccessException.java +++ b/api/src/main/java/org/openmrs/module/reporting/IllegalDatabaseAccessException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting; diff --git a/api/src/main/java/org/openmrs/module/reporting/ReportingConstants.java b/api/src/main/java/org/openmrs/module/reporting/ReportingConstants.java index f5d9176be9..7558ce8fd2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/ReportingConstants.java +++ b/api/src/main/java/org/openmrs/module/reporting/ReportingConstants.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting; @@ -54,6 +50,7 @@ public class ReportingConstants implements GlobalPropertyListener { public static final String GLOBAL_PROPERTY_DEFAULT_DATE_FORMAT = "reporting.defaultDateFormat"; public static final String GLOBAL_PROPERTY_TEST_PATIENTS_COHORT_DEFINITION = "reporting.testPatientsCohortDefinition"; public static final String GLOBAL_PROPERTY_EVALUATION_LOGGER_ENABLED = "reporting.evaluationLoggerEnabled"; + public static final String GLOBAL_PROPERTY_LOAD_REPORTS_FROM_CONFIGURATION_AT_STARTUP = "reporting.loadReportsFromConfigurationAtStartup"; public static final String DEFAULT_LOCALE_GP_NAME = "reporting.defaultLocale"; public static final List CACHED_PROPERTIES = Arrays.asList( @@ -113,6 +110,10 @@ public static final boolean GLOBAL_PROPERTY_INCLUDE_DATA_EXPORTS() { return getPropertyValueAsBoolean(GLOBAL_PROPERTY_INCLUDE_DATA_EXPORTS, false); } + public static final boolean GLOBAL_PROPERTY_LOAD_REPORTS_FROM_CONFIGURATION_AT_STARTUP() { + return getPropertyValueAsBoolean(GLOBAL_PROPERTY_LOAD_REPORTS_FROM_CONFIGURATION_AT_STARTUP, false); + } + // this property is fetched a lot, so we cache it public static final Locale GLOBAL_PROPERTY_DEFAULT_LOCALE() { if (gpCache.containsKey(DEFAULT_LOCALE_GP_NAME)) { diff --git a/api/src/main/java/org/openmrs/module/reporting/ReportingException.java b/api/src/main/java/org/openmrs/module/reporting/ReportingException.java index d6d2b67781..74726d7987 100644 --- a/api/src/main/java/org/openmrs/module/reporting/ReportingException.java +++ b/api/src/main/java/org/openmrs/module/reporting/ReportingException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting; diff --git a/api/src/main/java/org/openmrs/module/reporting/ReportingModuleActivator.java b/api/src/main/java/org/openmrs/module/reporting/ReportingModuleActivator.java index 8a020ccfb7..1d6562135b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/ReportingModuleActivator.java +++ b/api/src/main/java/org/openmrs/module/reporting/ReportingModuleActivator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting; @@ -20,6 +16,7 @@ import org.openmrs.module.DaemonToken; import org.openmrs.module.DaemonTokenAware; import org.openmrs.module.reporting.common.MessageUtil; +import org.openmrs.module.reporting.config.ReportLoader; import org.openmrs.module.reporting.report.task.ReportingTimerTask; import org.openmrs.module.reporting.report.task.RunQueuedReportsTask; @@ -39,6 +36,10 @@ public void contextRefreshed() { @Override public void started() { ReportingTimerTask.setEnabled(true); + if (ReportingConstants.GLOBAL_PROPERTY_LOAD_REPORTS_FROM_CONFIGURATION_AT_STARTUP()) { + // TODO: should this happen in context refreshed instead? + ReportLoader.loadReportsFromConfig(); + } log.info("Reporting Module Started..."); } diff --git a/api/src/main/java/org/openmrs/module/reporting/calculation/DataCalculation.java b/api/src/main/java/org/openmrs/module/reporting/calculation/DataCalculation.java index cc3b81dfc4..86c0bcfaf2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/calculation/DataCalculation.java +++ b/api/src/main/java/org/openmrs/module/reporting/calculation/DataCalculation.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; diff --git a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculation.java b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculation.java index 49c95944ce..aa402a0754 100644 --- a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculation.java +++ b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculation.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; diff --git a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationProvider.java b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationProvider.java index 609a431a0e..b3bdf13d4d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationProvider.java +++ b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationProvider.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; diff --git a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationSuggestion.java b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationSuggestion.java index 0cb13d1642..7ef1b9dee5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationSuggestion.java +++ b/api/src/main/java/org/openmrs/module/reporting/calculation/PatientDataCalculationSuggestion.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; diff --git a/api/src/main/java/org/openmrs/module/reporting/calculation/ReportingCalculationUtil.java b/api/src/main/java/org/openmrs/module/reporting/calculation/ReportingCalculationUtil.java index 6b7b9a637b..c3df68d02e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/calculation/ReportingCalculationUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/calculation/ReportingCalculationUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.calculation; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/CohortUtil.java b/api/src/main/java/org/openmrs/module/reporting/cohort/CohortUtil.java index 43c4ba8596..b78a500e7c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/CohortUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/CohortUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/Cohorts.java b/api/src/main/java/org/openmrs/module/reporting/cohort/Cohorts.java index 13b1e1a1dd..fb5c4ce360 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/Cohorts.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/Cohorts.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/EvaluatedCohort.java b/api/src/main/java/org/openmrs/module/reporting/cohort/EvaluatedCohort.java index 26b39ff904..271497d525 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/EvaluatedCohort.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/EvaluatedCohort.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/PatientIdSet.java b/api/src/main/java/org/openmrs/module/reporting/cohort/PatientIdSet.java index d6b8175487..28a7d3927c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/PatientIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/PatientIdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AgeCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AgeCohortDefinition.java index 1554e4b829..86743d5df9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AgeCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AgeCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AllPatientsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AllPatientsCohortDefinition.java index db2a969a59..e66bb59941 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AllPatientsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/AllPatientsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseCohortDefinition.java index 3c8a33ad73..39560627a8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseObsCohortDefinition.java index 52c7fd4bc9..a8fe9c13b1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BaseObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BirthAndDeathCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BirthAndDeathCohortDefinition.java index 41a5353c42..76aa6f6fed 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BirthAndDeathCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/BirthAndDeathCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; @@ -34,6 +30,9 @@ public class BirthAndDeathCohortDefinition extends BaseCohortDefinition { @ConfigurationProperty(group="birth") private Date bornOnOrBefore; + + @ConfigurationProperty(group="death") + private Boolean died; @ConfigurationProperty(group="death") private Date diedOnOrAfter; @@ -43,7 +42,7 @@ public class BirthAndDeathCohortDefinition extends BaseCohortDefinition { public BirthAndDeathCohortDefinition() { } - + /** * @return the bornOnOrAfter */ @@ -51,7 +50,7 @@ public Date getBornOnOrAfter() { return bornOnOrAfter; } - + /** * @param bornOnOrAfter the bornOnOrAfter to set */ @@ -75,7 +74,21 @@ public void setBornOnOrBefore(Date bornOnOrBefore) { this.bornOnOrBefore = bornOnOrBefore; } - + + /** + * @return whether the definition is configured to return patients who have been marked as died + */ + public Boolean getDied() { + return died; + } + + /** + * @param died set to true indicates to return patients who have been marked as died + */ + public void setDied(Boolean died) { + this.died = died; + } + /** * @return the diedOnOrAfter */ diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CodedObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CodedObsCohortDefinition.java index 0c69b10606..7c72222ef1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CodedObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CodedObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CohortDefinition.java index 19a6ba50e4..217dca4b75 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CompositionCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CompositionCohortDefinition.java index 053f07629f..9431a53466 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CompositionCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/CompositionCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionCohortDefinition.java new file mode 100644 index 0000000000..e2e4818b6e --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionCohortDefinition.java @@ -0,0 +1,141 @@ + +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.cohort.definition; + +import org.openmrs.Concept; +import org.openmrs.module.reporting.common.Localized; +import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; +import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy; +import org.openmrs.module.reporting.evaluation.caching.Caching; + +import java.util.Date; + +@Caching(strategy = ConfigurationPropertyCachingStrategy.class) +@Localized("reporting.ConditionCohortDefinition") +public class ConditionCohortDefinition extends BaseCohortDefinition { + + public static final long serialVersionUID = 1L; + + @ConfigurationProperty(value = "conditionCoded") + private Concept conditionCoded; + + @ConfigurationProperty(value = "conditionNonCoded") + private String conditionNonCoded; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date onsetDateOnOrBefore; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date onsetDateOnOrAfter; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date endDateOnOrBefore; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date endDateOnOrAfter; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date createdOnOrBefore; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date createdOnOrAfter; + + @ConfigurationProperty(group = "obsDatetimeGroup") + private Date activeOnDate; + + public Concept getConditionCoded() { + return conditionCoded; + } + + public void setConditionCoded(Concept conditionCoded) { + this.conditionCoded = conditionCoded; + } + + public String getConditionNonCoded() { + return conditionNonCoded; + } + + public void setConditionNonCoded(String conditionNonCoded) { + this.conditionNonCoded = conditionNonCoded; + } + + + public Date getOnsetDateOnOrBefore() { + return onsetDateOnOrBefore; + } + + + public void setOnsetDateOnOrBefore(Date onsetDateOnOrBefore) { + this.onsetDateOnOrBefore = onsetDateOnOrBefore; + } + + + public Date getOnsetDateOnOrAfter() { + return onsetDateOnOrAfter; + } + + + public void setOnsetDateOnOrAfter(Date onsetDateOnOrAfter) { + this.onsetDateOnOrAfter = onsetDateOnOrAfter; + } + + + public Date getEndDateOnOrBefore() { + return endDateOnOrBefore; + } + + + public void setEndDateOnOrBefore(Date endDateOnOrBefore) { + this.endDateOnOrBefore = endDateOnOrBefore; + } + + + public Date getEndDateOnOrAfter() { + return endDateOnOrAfter; + } + + + public void setEndDateOnOrAfter(Date endDateOnOrAfter) { + this.endDateOnOrAfter = endDateOnOrAfter; + } + + + public Date getCreatedOnOrBefore() { + return createdOnOrBefore; + } + + + public void setCreatedOnOrBefore(Date createdOnOrBefore) { + this.createdOnOrBefore = createdOnOrBefore; + } + + + public Date getCreatedOnOrAfter() { + return createdOnOrAfter; + } + + + public void setCreatedOnOrAfter(Date createdOnOrAfter) { + this.createdOnOrAfter = createdOnOrAfter; + } + + + public Date getActiveOnDate() { + return activeOnDate; + } + + + public void setActiveOnDate(Date activeOnDate) { + this.activeOnDate = activeOnDate; + } + + +} diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionalParameterCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionalParameterCohortDefinition.java index 4dc943824e..df05ed80bf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionalParameterCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ConditionalParameterCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DateObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DateObsCohortDefinition.java index 75bedd5bd6..68066debf4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DateObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DateObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DefinitionLibraryCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DefinitionLibraryCohortDefinition.java index 1cc417ad61..0c316c5678 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DefinitionLibraryCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DefinitionLibraryCohortDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition; import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DrugOrderCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DrugOrderCohortDefinition.java new file mode 100644 index 0000000000..3f5427244b --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/DrugOrderCohortDefinition.java @@ -0,0 +1,193 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ + +package org.openmrs.module.reporting.cohort.definition; + +import org.openmrs.CareSetting; +import org.openmrs.Concept; +import org.openmrs.Drug; +import org.openmrs.module.reporting.common.Localized; +import org.openmrs.module.reporting.common.Match; +import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; +import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy; +import org.openmrs.module.reporting.evaluation.caching.Caching; + +import java.util.Date; +import java.util.List; + +@Caching(strategy = ConfigurationPropertyCachingStrategy.class) +@Localized("reporting.DrugOrderCohortDefinition") +public class DrugOrderCohortDefinition extends BaseCohortDefinition { + + public static final long serialVersionUID = 1L; + + @ConfigurationProperty(group = "which") + private Match which; + + @ConfigurationProperty(value = "drugConcepts") + private List drugConcepts; + + @ConfigurationProperty(value = "drugSets") + private List drugSets; + + @ConfigurationProperty(value = "activatedOnOrBefore") + private Date activatedOnOrBefore; + + @ConfigurationProperty(value = "activatedOnOrAfter") + private Date activatedOnOrAfter; + + @ConfigurationProperty(value = "activeOnOrBefore") + private Date activeOnOrBefore; + + @ConfigurationProperty(value = "activeOnOrAfter") + private Date activeOnOrAfter; + + @ConfigurationProperty(value = "activeOnDate") + private Date activeOnDate; + + @ConfigurationProperty(value = "careSetting") + private CareSetting careSetting; + + @ConfigurationProperty(value = "drugs") + private List drugs; + + public DrugOrderCohortDefinition() { + } + + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("Patients "); + + if (this.which != null) { + builder.append(" taking " + this.which.toString() + " of the drugs "); + } + + if (this.getDrugConcepts() != null && this.getDrugConcepts().size() > 0) { + builder.append("taking generic drugs, or drugs with ingredients "); + for (Concept concept : this.getDrugConcepts()) { + builder.append(concept.getDisplayString() + " "); + } + } + if (this.getDrugSets() != null && this.getDrugSets().size() > 0) { + for (Concept concept : this.getDrugSets()) { + builder.append(concept.getDisplayString() + " "); + } + } + + if (this.getDrugs() != null && this.getDrugs().size() > 0) { + for (Drug drug : this.getDrugs()) { + builder.append(drug.getDisplayName() + " "); + } + + } + + if (this.getActivatedOnOrBefore() != null) { + builder.append("activated on or before " + this.getActivatedOnOrBefore() + " "); + } + if (this.getActivatedOnOrAfter() != null) { + builder.append("activated on or after " + this.getActivatedOnOrAfter() + " "); + } + + if (this.getActiveOnOrBefore() != null) { + builder.append("been active on or before " + this.getActiveOnOrBefore() + " "); + } + if (this.getActiveOnOrAfter() != null) { + builder.append("been active on or before " + this.getActiveOnOrAfter() + " "); + } + if (this.getActiveOnDate() != null) { + builder.append("active by " + this.getActiveOnDate() + " "); + } + if (this.careSetting != null) { + builder.append("with care setting of " + this.careSetting + " "); + } + return builder.toString(); + } + + public Match getWhich() { + return this.which; + } + + public void setWhich(Match which) { + this.which = which; + } + + public List getDrugConcepts() { + return drugConcepts; + } + + public void setDrugConcepts(List drugConcepts) { + this.drugConcepts = drugConcepts; + } + + public List getDrugSets() { + return drugSets; + } + + public void setDrugSets(List drugSets) { + this.drugSets = drugSets; + } + + public List getDrugs() { + return drugs; + } + + public void setDrugs(List drugs) { + this.drugs = drugs; + } + + public Date getActivatedOnOrBefore() { + return activatedOnOrBefore; + } + + public void setActivatedOnOrBefore(Date activatedOnOrBefore) { + this.activatedOnOrBefore = activatedOnOrBefore; + } + + public Date getActivatedOnOrAfter() { + return activatedOnOrAfter; + } + + public void setActivatedOnOrAfter(Date activatedOnOrAfter) { + this.activatedOnOrAfter = activatedOnOrAfter; + } + + public Date getActiveOnOrBefore() { + return activeOnOrBefore; + } + + public void setActiveOnOrBefore(Date activeOnOrBefore) { + this.activeOnOrBefore = activeOnOrBefore; + } + + public Date getActiveOnOrAfter() { + return activeOnOrAfter; + } + + public void setActiveOnOrAfter(Date activeOnOrAfter) { + this.activeOnOrAfter = activeOnOrAfter; + } + + public Date getActiveOnDate() { + return activeOnDate; + } + + public void setActiveOnDate(Date activeOnDate) { + this.activeOnDate = activeOnDate; + } + + public CareSetting getCareSetting() { + return careSetting; + } + + public void setCareSetting(CareSetting careSetting) { + this.careSetting = careSetting; + } + +} \ No newline at end of file diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterCohortDefinition.java index 0eefd97a81..8711a0217b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterWithCodedObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterWithCodedObsCohortDefinition.java index 4e838fb474..64ab77ffe0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterWithCodedObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterWithCodedObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EvaluatableCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EvaluatableCohortDefinition.java index 15adb4c212..ff32613266 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EvaluatableCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EvaluatableCohortDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition; import org.openmrs.module.reporting.cohort.EvaluatedCohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/GenderCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/GenderCohortDefinition.java index ef8087128c..3fa5a4760f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/GenderCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/GenderCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InProgramCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InProgramCohortDefinition.java index 341b712939..8437180f29 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InProgramCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InProgramCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InStateCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InStateCohortDefinition.java index c108472fb6..cf00ee1eac 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InStateCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InStateCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InverseCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InverseCohortDefinition.java index 7d113e0263..6d0f90cf1c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InverseCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/InverseCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/LogicCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/LogicCohortDefinition.java index 762da227d4..d82538ae45 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/LogicCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/LogicCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/MappedParametersCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/MappedParametersCohortDefinition.java index d35c0cdaca..571cc52d5a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/MappedParametersCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/MappedParametersCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/NumericObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/NumericObsCohortDefinition.java index 12afcf5e11..6630599621 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/NumericObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/NumericObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ObsInEncounterCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ObsInEncounterCohortDefinition.java index 5f089a72a8..424b1f86ab 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ObsInEncounterCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ObsInEncounterCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/OptionalParameterCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/OptionalParameterCohortDefinition.java index d2f3077549..748e85c34f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/OptionalParameterCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/OptionalParameterCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientIdentifierCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientIdentifierCohortDefinition.java index 93e46c4421..2b20e44711 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientIdentifierCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientIdentifierCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientStateCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientStateCohortDefinition.java index 000e74f299..732b56a3b9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientStateCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PatientStateCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PersonAttributeCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PersonAttributeCohortDefinition.java index c8342896a4..93d31eb586 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PersonAttributeCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PersonAttributeCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PresenceOrAbsenceCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PresenceOrAbsenceCohortDefinition.java index 6b5aa69dd3..efc2243936 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PresenceOrAbsenceCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/PresenceOrAbsenceCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ProgramEnrollmentCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ProgramEnrollmentCohortDefinition.java index 9ee95c3506..a994167649 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ProgramEnrollmentCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ProgramEnrollmentCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ScriptedCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ScriptedCohortDefinition.java index 20ca013247..969ae5ba2c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ScriptedCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/ScriptedCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/SqlCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/SqlCohortDefinition.java index 2a3c250067..f738e2bcc9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/SqlCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/SqlCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/StaticCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/StaticCohortDefinition.java index b4736ac1e1..ce7c168c9c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/StaticCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/StaticCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/TextObsCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/TextObsCohortDefinition.java index f463764ae9..15efad1a40 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/TextObsCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/TextObsCohortDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/VisitCohortDefinition.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/VisitCohortDefinition.java index 204594f59a..e7c60f2f4f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/VisitCohortDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/VisitCohortDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition; import org.openmrs.Concept; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluator.java index 09ff96283f..fb375a6d15 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AgeCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluator.java index 7431ef3f51..1dbca99df9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/AllPatientsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BaseObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BaseObsCohortDefinitionEvaluator.java index 02f604492a..81f961700d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BaseObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BaseObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluator.java index 82bc8d4535..331e5d7ae2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/BirthAndDeathCohortDefinitionEvaluator.java @@ -1,29 +1,30 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.openmrs.Cohort; +import org.openmrs.Patient; import org.openmrs.annotation.Handler; -import org.openmrs.api.context.Context; import org.openmrs.module.reporting.cohort.EvaluatedCohort; import org.openmrs.module.reporting.cohort.definition.BirthAndDeathCohortDefinition; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; -import org.openmrs.module.reporting.cohort.query.service.CohortQueryService; import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.springframework.beans.factory.annotation.Autowired; @Handler(supports={BirthAndDeathCohortDefinition.class}) public class BirthAndDeathCohortDefinitionEvaluator implements CohortDefinitionEvaluator { + + @Autowired + EvaluationService evaluationService; public BirthAndDeathCohortDefinitionEvaluator() { } @@ -39,12 +40,18 @@ public BirthAndDeathCohortDefinitionEvaluator() { } * @should find patients that died after the specified date */ public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) { - BirthAndDeathCohortDefinition definition = (BirthAndDeathCohortDefinition) cohortDefinition; - Cohort c = Context.getService(CohortQueryService.class).getPatientsHavingBirthAndDeath( - definition.getBornOnOrAfter(), - definition.getBornOnOrBefore(), - definition.getDiedOnOrAfter(), - definition.getDiedOnOrBefore()); + BirthAndDeathCohortDefinition cd = (BirthAndDeathCohortDefinition) cohortDefinition; + + HqlQueryBuilder q = new HqlQueryBuilder(); + q.select("p.patient.id"); + q.from(Patient.class, "p"); + q.whereGreaterOrEqualTo("p.birthdate", cd.getBornOnOrAfter()); + q.whereLessOrEqualTo("p.birthdate", cd.getBornOnOrBefore()); + q.whereEqual("p.dead", cd.getDied()); + q.whereGreaterOrEqualTo("p.deathDate", cd.getDiedOnOrAfter()); + q.whereLessOrEqualTo("p.deathDate", cd.getDiedOnOrBefore()); + Cohort c = new Cohort(evaluationService.evaluateToList(q, Integer.class, context)); + return new EvaluatedCohort(c, cohortDefinition, context); } diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluator.java index b034f8e8db..07f50f088d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CodedObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CohortDefinitionEvaluator.java index 08e2e166c8..6fa4c80af1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluator.java index 1440030e9e..53e1fdd761 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/CompositionCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluator.java new file mode 100644 index 0000000000..a9b13598e9 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionCohortDefinitionEvaluator.java @@ -0,0 +1,54 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.cohort.definition.evaluator; + +import org.openmrs.Cohort; +import org.openmrs.Condition; +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.cohort.EvaluatedCohort; +import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.cohort.definition.ConditionCohortDefinition; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +@Handler(supports = { ConditionCohortDefinition.class }) +public class ConditionCohortDefinitionEvaluator implements CohortDefinitionEvaluator { + + @Autowired + EvaluationService evaluationService; + + @Override + public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) { + + ConditionCohortDefinition cd = (ConditionCohortDefinition) cohortDefinition; + + HqlQueryBuilder query = new HqlQueryBuilder(); + query.select("c.patient.patientId") + .from(Condition.class, "c") + .wherePatientIn("c.patient.patientId", context) + .whereEqual("c.condition.coded", cd.getConditionCoded()) + .whereEqual("c.condition.nonCoded", cd.getConditionNonCoded()) + .whereGreaterOrEqualTo("c.dateCreated", cd.getCreatedOnOrAfter()) + .whereLessOrEqualTo("c.dateCreated", cd.getCreatedOnOrBefore()) + .whereGreaterOrEqualTo("c.onsetDate", cd.getOnsetDateOnOrAfter()) + .whereLessOrEqualTo("c.onsetDate", cd.getOnsetDateOnOrBefore()) + .whereGreaterOrEqualTo("c.endDate", cd.getEndDateOnOrAfter()) + .whereLessOrEqualTo("c.endDate", cd.getEndDateOnOrBefore()) + .whereGreaterOrEqualTo("c.endDate", cd.getActiveOnDate()) + .whereLessOrEqualTo("c.onsetDate", cd.getActiveOnDate()); + List patientIds = evaluationService.evaluateToList(query, Integer.class, context); + Cohort cohort = new Cohort(patientIds); + return new EvaluatedCohort(cohort, cd, context); + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluator.java index 39878395cc..3fb1c856ce 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ConditionalParameterCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluator.java index 58c8e68597..621a7aca52 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DateObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluator.java index 85b01d83f6..ec7829ed1b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DefinitionLibraryCohortDefinitionEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluator.java new file mode 100644 index 0000000000..f6ac3c19f6 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/DrugOrderCohortDefinitionEvaluator.java @@ -0,0 +1,119 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ + +package org.openmrs.module.reporting.cohort.definition.evaluator; + +import org.openmrs.Cohort; +import org.openmrs.DrugOrder; +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.cohort.EvaluatedCohort; +import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition; +import org.openmrs.module.reporting.common.Match; +import org.openmrs.module.reporting.common.ObjectUtil; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +@Handler(supports = { DrugOrderCohortDefinition.class }) +public class DrugOrderCohortDefinitionEvaluator implements CohortDefinitionEvaluator { + + @Autowired + EvaluationService evaluationService; + + public DrugOrderCohortDefinitionEvaluator() { + } + + public EvaluatedCohort evaluate(CohortDefinition cohortDefinition, EvaluationContext context) { + DrugOrderCohortDefinition drugOrderCohortDefinition = (DrugOrderCohortDefinition) cohortDefinition; + context = ObjectUtil.nvl(context, new EvaluationContext()); + + HqlQueryBuilder query = new HqlQueryBuilder(); + query.select("drugOrder.patient.patientId"); + query.from(DrugOrder.class, "drugOrder"); + + query.wherePatientIn("drugOrder.patient.patientId", context); + + if (drugOrderCohortDefinition.getWhich() == null) drugOrderCohortDefinition.setWhich(Match.ANY); + + if (drugOrderCohortDefinition.getDrugSets() != null) { + + if (drugOrderCohortDefinition.getWhich() == Match.ANY) { + query.whereInAny("drugOrder.concept", drugOrderCohortDefinition.getDrugSets().toArray()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.ALL) { + query.whereIn("drugOrder.concept", drugOrderCohortDefinition.getDrugSets()); + query.groupBy( + "drugOrder.patient.patientId" + " having count(distinct drugOrder.concept.conceptId) = " + drugOrderCohortDefinition.getDrugSets().size()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.NONE) { + query.whereNotInAny("drugOrder.concept", drugOrderCohortDefinition.getDrugSets()); + } + } + + if (drugOrderCohortDefinition.getDrugConcepts() != null) { + if (drugOrderCohortDefinition.getWhich() == Match.ANY) { + query.whereInAny("drugOrder.concept", drugOrderCohortDefinition.getDrugConcepts().toArray()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.ALL) { + query.whereIn("drugOrder.concept", drugOrderCohortDefinition.getDrugConcepts()); + query.groupBy( + "drugOrder.patient.patientId" + " having count(distinct drugOrder.concept.conceptId) = " + drugOrderCohortDefinition.getDrugSets().size()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.NONE) { + query.whereNotInAny("drugOrder.concept", drugOrderCohortDefinition.getDrugConcepts()); + } + } + + if (drugOrderCohortDefinition.getDrugs() != null) { + if (drugOrderCohortDefinition.getWhich() == Match.ANY) { + query.whereInAny("drugOrder.drug", drugOrderCohortDefinition.getDrugs().toArray()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.ALL) { + query.whereIn("drugOrder.drug", drugOrderCohortDefinition.getDrugs()); + query.groupBy( + "drugOrder.patient.patientId" + " having count(distinct drugOrder.drug.drugId) = " + drugOrderCohortDefinition.getDrugs().size()); + } + else if (drugOrderCohortDefinition.getWhich() == Match.NONE) { + query.whereNotInAny("drugOrder.drug", drugOrderCohortDefinition.getDrugs()); + } + } + + query.whereLessOrEqualTo("drugOrder.dateActivated", drugOrderCohortDefinition.getActivatedOnOrBefore()); + query.whereGreaterOrEqualTo("drugOrder.dateActivated", drugOrderCohortDefinition.getActivatedOnOrAfter()); + query.whereEqual("drugOrder.careSetting", drugOrderCohortDefinition.getCareSetting()); + + if (drugOrderCohortDefinition.getActiveOnOrBefore() != null) { + query.whereNotNull("drugOrder.dateActivated").and() + .whereLessOrEqualTo("drugOrder.dateStopped", drugOrderCohortDefinition.getActiveOnOrBefore()) + .or() + .whereLessOrEqualTo("drugOrder.autoExpireDate", drugOrderCohortDefinition.getActiveOnOrBefore()); + } + + query.whereNotNull("drugOrder.dateActivated").and() + .whereGreaterEqualOrNull("drugOrder.dateStopped", drugOrderCohortDefinition.getActiveOnOrAfter()) + .and() + .whereGreaterEqualOrNull("drugOrder.autoExpireDate", drugOrderCohortDefinition.getActiveOnOrAfter()); + + query.whereNotNull("drugOrder.dateActivated").and() + .whereLessOrEqualTo("drugOrder.dateActivated", drugOrderCohortDefinition.getActiveOnDate()) + .whereGreaterOrNull("drugOrder.dateStopped", drugOrderCohortDefinition.getActiveOnDate()) + .and() + .whereGreaterOrNull("drugOrder.autoExpireDate", drugOrderCohortDefinition.getActiveOnDate()); + + List patientIds = evaluationService.evaluateToList(query, Integer.class, context); + Cohort cohort = new Cohort(patientIds); + + return new EvaluatedCohort(cohort, drugOrderCohortDefinition, context); + } +} \ No newline at end of file diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluator.java index 01cd33b92c..39ff298bf3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluator.java index 3984937bd8..e6b56c4c4c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EncounterWithCodedObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluator.java index cd236ae39d..73ed824cee 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/EvaluatableCohortDefinitionEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.cohort.definition.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluator.java index ff7b472afc..455460a425 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/GenderCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluator.java index f744785487..77212d6486 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InProgramCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluator.java index 6c0ff8af67..1b739ac93d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InStateCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluator.java index c15541f28b..2648dcde72 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/InverseCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/LogicCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/LogicCohortDefinitionEvaluator.java index 4e98706a60..b839988676 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/LogicCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/LogicCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluator.java index 7fbbff2dcc..d8021a3ae3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/MappedParametersCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluator.java index ac97e790f8..651b391234 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/NumericObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ObsInEncounterCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ObsInEncounterCohortDefinitionEvaluator.java index 7e36aa4e7c..bc0ba345b1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ObsInEncounterCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ObsInEncounterCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluator.java index 4806b30380..677cc59473 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/OptionalParameterCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluator.java index 3814a9e27c..5d2fb90a66 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientIdentifierCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluator.java index 8bf2abded2..7bc35d7613 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PatientStateCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluator.java index 6ab979c446..367c083727 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PersonAttributeCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluator.java index 8951726928..808e30fee4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/PresenceOrAbsenceCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluator.java index db716fe8e8..697a2e1ef0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ProgramEnrollmentCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluator.java index 16c6add5d7..8cafc34e01 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/ScriptedCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluator.java index 40773899a3..e1faa0dce5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/SqlCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/StaticCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/StaticCohortDefinitionEvaluator.java index b42fec74c8..a6257ed5b0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/StaticCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/StaticCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluator.java index 878d82d142..f7f044441c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/TextObsCohortDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluator.java index 9bfab6d77f..027ea1d3f4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/evaluator/VisitCohortDefinitionEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.evaluator; import org.openmrs.Cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/handler/SqlCohortDefinitionSaveHandler.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/handler/SqlCohortDefinitionSaveHandler.java index 7fc778b15d..05809f8079 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/handler/SqlCohortDefinitionSaveHandler.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/handler/SqlCohortDefinitionSaveHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionHistory.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionHistory.java index f1bfcf1e43..8f919fa1b2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionHistory.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionHistory.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.history; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionSearchHistory.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionSearchHistory.java index 7b2d13c32c..6dba79d342 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionSearchHistory.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/history/CohortDefinitionSearchHistory.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.history; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibrary.java index 0fbd7458a5..fc0eb2791c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/library/BuiltInCohortDefinitionLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.cohort.definition.library; import org.openmrs.EncounterType; @@ -24,6 +19,7 @@ import org.openmrs.module.reporting.cohort.definition.AgeCohortDefinition; import org.openmrs.module.reporting.cohort.definition.BirthAndDeathCohortDefinition; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.cohort.definition.ConditionCohortDefinition; import org.openmrs.module.reporting.cohort.definition.EncounterCohortDefinition; import org.openmrs.module.reporting.cohort.definition.GenderCohortDefinition; import org.openmrs.module.reporting.cohort.definition.InProgramCohortDefinition; @@ -42,7 +38,7 @@ import org.openmrs.module.reporting.cohort.definition.TextObsCohortDefinition; import org.openmrs.module.reporting.cohort.definition.DateObsCohortDefinition; import org.openmrs.module.reporting.common.RangeComparator; - +import org.openmrs.module.reporting.common.SetComparator; import java.util.Date; import java.util.List; @@ -127,6 +123,7 @@ public CohortDefinition getCodedObsSearchAdvanced() { cd.addParameter(new Parameter("values", "reporting.parameter.valueList", Concept.class, List.class, null)); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class)); + cd.addParameter(new Parameter("operator", "reporting.parameter.operator", SetComparator.class)); return cd; } @@ -166,6 +163,7 @@ public CohortDefinition getTextObsSearchAdvanced() { cd.addParameter(new Parameter("values", "reporting.parameter.valueList", Concept.class, List.class, null)); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class)); + cd.addParameter(new Parameter("operator", "reporting.parameter.operator", SetComparator.class)); return cd; } @@ -203,6 +201,7 @@ public CohortDefinition getBornDuringPeriod() { @DocumentedDefinition("diedDuringPeriod") public CohortDefinition getDiedDuringPeriod() { BirthAndDeathCohortDefinition cd = new BirthAndDeathCohortDefinition(); + cd.setDied(true); cd.addParameter(new Parameter("diedOnOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("diedOnOrBefore", "reporting.parameter.endDate", Date.class)); return new MappedParametersCohortDefinition(cd, "diedOnOrAfter", "startDate", "diedOnOrBefore", "endDate"); @@ -274,4 +273,19 @@ public CohortDefinition getPatientsInState() { cd.addParameter(new Parameter("onDate", "reporting.parameter.date", Date.class)); return cd; } + + @DocumentedDefinition("conditonSearchAdvanced") + public CohortDefinition getConditonSearchAdvanced() { + ConditionCohortDefinition cd = new ConditionCohortDefinition(); + cd.addParameter(new Parameter("conditionCoded", "reporting.parameter.conditionCoded", Concept.class)); + cd.addParameter(new Parameter("conditionNonCoded", "reporting.parameter.conditionNonCoded", String.class)); + cd.addParameter(new Parameter("onsetDateOnOrBefore", "reporting.parameter.onsetDateOnOrBefore", Date.class)); + cd.addParameter(new Parameter("onsetDateOnOrAfter", "reporting.parameter.onsetDateOnOrAfter", Date.class)); + cd.addParameter(new Parameter("endDateOnOrBefore", "reporting.parameter.endDateOnOrBefore", Date.class)); + cd.addParameter(new Parameter("endDateOnOrAfter", "reporting.parameter.endDateOnOrAfter", Date.class)); + cd.addParameter(new Parameter("createdOnOrBefore", "reporting.parameter.createdOnOrBefore", Date.class)); + cd.addParameter(new Parameter("createdOnOrAfter", "reporting.parameter.createdOnOrAfter", Date.class)); + cd.addParameter(new Parameter("activeOnDate", "reporting.parameter.activeOnDate", Date.class)); + return cd; + } } diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/CohortDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/CohortDefinitionPersister.java index 422f54c30c..5b59eb3268 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/CohortDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/CohortDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/MockCohortDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/MockCohortDefinitionPersister.java index a1a1634dc1..c51ec72d5b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/MockCohortDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/MockCohortDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/SerializedCohortDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/SerializedCohortDefinitionPersister.java index 4182050d1a..34d4371b38 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/SerializedCohortDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/SerializedCohortDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/StaticCohortDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/StaticCohortDefinitionPersister.java index 8d0879a4d2..d46b7dfc92 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/StaticCohortDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/persister/StaticCohortDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionService.java index e06c0a75f0..417eedd5d3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionServiceImpl.java index 6a460c5a7a..a2fbc0fe46 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/service/CohortDefinitionServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortExpressionParser.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortExpressionParser.java index d9d4d0b457..8b3121989b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortExpressionParser.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortExpressionParser.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.util; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortFilter.java b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortFilter.java index d6caed7df5..6a5fb49bbe 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortFilter.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/definition/util/CohortFilter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.definition.util; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/CohortQueryDAO.java b/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/CohortQueryDAO.java index fcf435c336..bbe3e2a204 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/CohortQueryDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/CohortQueryDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.query.db; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/hibernate/HibernateCohortQueryDAO.java b/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/hibernate/HibernateCohortQueryDAO.java index 2180555a0c..390f69ba77 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/hibernate/HibernateCohortQueryDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/query/db/hibernate/HibernateCohortQueryDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.query.db.hibernate; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryService.java b/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryService.java index b76622af85..f5242d8943 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.query.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceImpl.java index c8727c305b..96f739cb78 100644 --- a/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/cohort/query/service/CohortQueryServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.cohort.query.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Age.java b/api/src/main/java/org/openmrs/module/reporting/common/Age.java index 4b8af3fa19..de4dfbb01d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/Age.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/Age.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/AgeRange.java b/api/src/main/java/org/openmrs/module/reporting/common/AgeRange.java index 7260c89b62..e0f20a628e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/AgeRange.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/AgeRange.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/AuditInfo.java b/api/src/main/java/org/openmrs/module/reporting/common/AuditInfo.java index 035d55afc9..051dede243 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/AuditInfo.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/AuditInfo.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.common; import org.openmrs.Auditable; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/BeanPropertyComparator.java b/api/src/main/java/org/openmrs/module/reporting/common/BeanPropertyComparator.java index 8ab2487036..f9bc29ca6f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/BeanPropertyComparator.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/BeanPropertyComparator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Birthdate.java b/api/src/main/java/org/openmrs/module/reporting/common/Birthdate.java index a90daf9a02..8891ea35b9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/Birthdate.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/Birthdate.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/BooleanOperator.java b/api/src/main/java/org/openmrs/module/reporting/common/BooleanOperator.java index 879392d54b..fabb049b5f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/BooleanOperator.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/BooleanOperator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ContentType.java b/api/src/main/java/org/openmrs/module/reporting/common/ContentType.java index 799aae0c61..c6cde00a48 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ContentType.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ContentType.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; @@ -23,7 +19,8 @@ public enum ContentType { XML("xml", "text/xml"), CSV("csv", "text/csv"), TEXT("text", "text/plain"), - ZIP("zip", "application/zip"); + ZIP("zip", "application/zip"), + PDF("pdf", "application/pdf"); //***** PROPERTIES ***** diff --git a/api/src/main/java/org/openmrs/module/reporting/common/DateRange.java b/api/src/main/java/org/openmrs/module/reporting/common/DateRange.java index 0aa85ac60c..ab5ab1c3fc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/DateRange.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/DateRange.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/DateUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/DateUtil.java index 3e4195577a..15204c83c4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/DateUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/DateUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.commons.lang3.time.DateUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/DelimitedKeyComparator.java b/api/src/main/java/org/openmrs/module/reporting/common/DelimitedKeyComparator.java index 8b91278fac..664385f4d9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/DelimitedKeyComparator.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/DelimitedKeyComparator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import java.util.Comparator; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/DrugOrderSet.java b/api/src/main/java/org/openmrs/module/reporting/common/DrugOrderSet.java index 31e08a65a4..a9cb444413 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/DrugOrderSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/DrugOrderSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/DurationUnit.java b/api/src/main/java/org/openmrs/module/reporting/common/DurationUnit.java index b7e780449b..db54fd288d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/DurationUnit.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/DurationUnit.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ExcelBuilder.java b/api/src/main/java/org/openmrs/module/reporting/common/ExcelBuilder.java index 8453f34ee4..e5efa96bd4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ExcelBuilder.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ExcelBuilder.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.poi.ss.usermodel.Cell; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ExcelUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/ExcelUtil.java index 5971274176..fc4ad881ec 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ExcelUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ExcelUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.commons.io.IOUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Fraction.java b/api/src/main/java/org/openmrs/module/reporting/common/Fraction.java index a49d9009ec..8ad2fbbca0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/Fraction.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/Fraction.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/GroovyHelper.java b/api/src/main/java/org/openmrs/module/reporting/common/GroovyHelper.java index f14a92fc15..24802d0c10 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/GroovyHelper.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/GroovyHelper.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import java.io.File; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/HibernateUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/HibernateUtil.java index c910a174e1..7523c5d1e8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/HibernateUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/HibernateUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ListMap.java b/api/src/main/java/org/openmrs/module/reporting/common/ListMap.java index f497fe59d0..dc92660284 100755 --- a/api/src/main/java/org/openmrs/module/reporting/common/ListMap.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ListMap.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Localized.java b/api/src/main/java/org/openmrs/module/reporting/common/Localized.java index ce94dba7cf..fa86aebfdf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/Localized.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/Localized.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/LogicUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/LogicUtil.java index c26d224ae7..63a100fcb4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/LogicUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/LogicUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import java.util.List; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Match.java b/api/src/main/java/org/openmrs/module/reporting/common/Match.java new file mode 100644 index 0000000000..2db7548c3b --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/common/Match.java @@ -0,0 +1,18 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.common; + +/** + * This enum is meant to represent the conditions which can be used to specify + * matching requirements + */ +public enum Match { + ANY, ALL, NONE +} diff --git a/api/src/main/java/org/openmrs/module/reporting/common/MessageUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/MessageUtil.java index b82f744578..e27be74a6a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/MessageUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/MessageUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/NumericRange.java b/api/src/main/java/org/openmrs/module/reporting/common/NumericRange.java index abffe8d478..dcfa7cc65e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/NumericRange.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/NumericRange.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ObjectCounter.java b/api/src/main/java/org/openmrs/module/reporting/common/ObjectCounter.java index d1b879d459..12260fa113 100755 --- a/api/src/main/java/org/openmrs/module/reporting/common/ObjectCounter.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ObjectCounter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ObjectUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/ObjectUtil.java index 9a0cd775c5..982d342c09 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ObjectUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ObjectUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.commons.io.IOUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ObsActiveList.java b/api/src/main/java/org/openmrs/module/reporting/common/ObsActiveList.java index eaf532128e..d971f087f3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ObsActiveList.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ObsActiveList.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/RangeComparator.java b/api/src/main/java/org/openmrs/module/reporting/common/RangeComparator.java index 16282a6d97..f5e4ef7132 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/RangeComparator.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/RangeComparator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ReflectionUtil.java b/api/src/main/java/org/openmrs/module/reporting/common/ReflectionUtil.java index bfc1d246e1..f459ae38c1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ReflectionUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ReflectionUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; import org.apache.commons.beanutils.PropertyUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ResultSetIterator.java b/api/src/main/java/org/openmrs/module/reporting/common/ResultSetIterator.java new file mode 100644 index 0000000000..2f8b77c5d8 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/common/ResultSetIterator.java @@ -0,0 +1,117 @@ +package org.openmrs.module.reporting.common; + +import org.openmrs.api.APIException; +import org.openmrs.module.reporting.dataset.DataSetColumn; +import org.openmrs.module.reporting.dataset.DataSetRow; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.NoSuchElementException; + +public class ResultSetIterator implements Iterator { + + private static final Logger log = LoggerFactory.getLogger(ResultSetIterator.class); + + private ResultSet resultSet; + private List columns; + private Connection connection; + private Statement statement; + private boolean isNextUsed = true; + private boolean hasNext = true; + + public ResultSetIterator(ResultSet resultSet) throws SQLException { + this.resultSet = resultSet; + this.statement = resultSet.getStatement(); + this.connection = resultSet.getStatement().getConnection(); + this.createDataSetColumns(resultSet.getMetaData()); + } + + @Override + public boolean hasNext() { + if (isNextUsed && hasNext) { + isNextUsed = false; + return rawNext(); + } + return hasNext; + } + + @Override + public DataSetRow next() throws NoSuchElementException { + try { + if (isNextUsed) { + if (rawNext()) { + return createDataSetRow(); + }else{ + return null; + } + } else { + isNextUsed = true; + return createDataSetRow(); + } + } catch (SQLException e) { + closeConnection(); + throw new APIException("Failed to fetch the next result from the database.", e); + } + } + + private boolean rawNext() { + try { + if (resultSet.next()) { + return true; + } else { + hasNext = false; + closeConnection(); + return false; + } + } catch (SQLException e) { + closeConnection(); + throw new APIException("Failed to fetch the next result from the database.", e); + } + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + + private DataSetRow createDataSetRow() throws SQLException { + DataSetRow dataSetRow = new DataSetRow(); + for (int i = 0; i < columns.size(); i++) { + dataSetRow.addColumnValue(columns.get(i), resultSet.getObject(i + 1)); + } + return dataSetRow; + } + + public void closeConnection() { + try { + if (statement != null) { + statement.close(); + } + if (connection != null) { + connection.close(); + } + } catch (Exception ex) { + log.error("Failed to close ResultSetIterator connection.", ex); + } + } + + public List getColumns() { + return columns; + } + + private void createDataSetColumns(ResultSetMetaData metadata) throws SQLException { + columns = new LinkedList(); + for (int i = 1; i <= metadata.getColumnCount(); i++) { + String columnName = metadata.getColumnLabel(i); + columns.add(new DataSetColumn(columnName, columnName, Object.class)); + } + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/common/ScriptingLanguage.java b/api/src/main/java/org/openmrs/module/reporting/common/ScriptingLanguage.java index d41fd10b77..f8ee185ddb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/ScriptingLanguage.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/ScriptingLanguage.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/SetComparator.java b/api/src/main/java/org/openmrs/module/reporting/common/SetComparator.java index 6ab9fae30d..7f1ec69a4d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/SetComparator.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/SetComparator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/common/SortCriteria.java b/api/src/main/java/org/openmrs/module/reporting/common/SortCriteria.java index 7a011bfb28..77588ade44 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/SortCriteria.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/SortCriteria.java @@ -1,18 +1,15 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; +import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -96,10 +93,12 @@ public enum SortDirection { //***** INNER CLASSES ***** - public class SortElement { - + public class SortElement implements Serializable { + + public static final long serialVersionUID = 1L; + //***** PROPERTIES ***** - + private String elementName; private SortDirection direction; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/SqlResult.java b/api/src/main/java/org/openmrs/module/reporting/common/SqlResult.java new file mode 100644 index 0000000000..bfa60017e1 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/common/SqlResult.java @@ -0,0 +1,69 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.common; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Encapsulates the result from executing a script with a SqlRunner + */ +public class SqlResult { + + private List columns; + private List> data; + private List errors; + + public List getColumns() { + if (columns == null) { + columns = new ArrayList(); + } + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public void addColumn(String column) { + getColumns().add(column); + } + + public List> getData() { + if (data == null) { + data = new ArrayList>(); + } + return data; + } + + public void setData(List> data) { + this.data = data; + } + + public void addData(Map row) { + getData().add(row); + } + + public List getErrors() { + if (errors == null) { + errors = new ArrayList(); + } + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + public void addError(String error) { + getErrors().add(error); + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/common/SqlRunner.java b/api/src/main/java/org/openmrs/module/reporting/common/SqlRunner.java new file mode 100644 index 0000000000..a79f1e798e --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/common/SqlRunner.java @@ -0,0 +1,391 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.common; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.OpenmrsObject; +import org.openmrs.module.reporting.report.util.ReportUtil; + +import java.io.File; +import java.io.IOException; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.ResultSetMetaData; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Executes a SQL script + */ +public class SqlRunner { + + private static Log log = LogFactory.getLog(SqlRunner.class); + + // Regular expression to identify a change in the delimiter. This ignores spaces, allows delimiter in comment, allows an equals-sign + private static final Pattern DELIMITER_PATTERN = Pattern.compile("^\\s*(--)?\\s*delimiter\\s*=?\\s*([^\\s]+)+\\s*.*$", Pattern.CASE_INSENSITIVE); + + //*********** INSTANCE PROPERTIES ****************** + + private Connection connection; + private String delimiter = ";"; + + //*********** CONSTRUCTORS ****************** + + public SqlRunner(Connection connection) { + this.connection = connection; + } + + public SqlRunner(Connection connection, String delimiter) { + this(connection); + this.delimiter = delimiter; + } + + /** + * Executes a Sql Script located under resources + */ + public SqlResult executeSqlResource(String resourceName, Map parameterValues) { + String sql = ReportUtil.readStringFromResource(resourceName); + return executeSql(sql, parameterValues); + } + + /** + * Executes a Sql Script located under resources + */ + public ResultSetIterator executeSqlResourceToIterator(String resourceName, Map parameterValues) { + String sql = ReportUtil.readStringFromResource(resourceName); + return executeSqlToIterator(sql, parameterValues); + } + + /** + * Executes a Sql Script located as a file + */ + public SqlResult executeSqlFile(File sqlFile, Map parameterValues) { + try { + String sql = FileUtils.readFileToString(sqlFile, "UTF-8"); + return executeSql(sql, parameterValues); + } + catch (IOException e) { + throw new IllegalArgumentException("Unable to load file: " + sqlFile, e); + } + } + + /** + * Executes a Sql Script located as a file + */ + public ResultSetIterator executeSqlFileToIterator(File sqlFile, Map parameterValues) { + try { + String sql = FileUtils.readFileToString(sqlFile, "UTF-8"); + return executeSqlToIterator(sql, parameterValues); + } + catch (IOException e) { + throw new IllegalArgumentException("Unable to load file: " + sqlFile, e); + } + } + + /** + * Executes a Sql Script + */ + public SqlResult executeSql(String sql, Map parameterValues) { + + SqlResult result = new SqlResult(); + log.info("Executing SQL..."); + + List sqlStatements = new ArrayList(); + sqlStatements.addAll(parseParametersIntoStatements(parameterValues)); + sqlStatements.addAll(parseSqlIntoStatements(sql)); + + Boolean originalAutoCommit = null; + + try { + originalAutoCommit = connection.getAutoCommit(); + connection.setAutoCommit(false); + + for (String sqlStatement : sqlStatements) { + Statement statement = null; + try { + statement = connection.createStatement(); + log.debug("Executing: " + sqlStatement); + statement.execute(sqlStatement); + ResultSet resultSet = statement.getResultSet(); + + if (resultSet != null) { + ResultSetMetaData rsmd = resultSet.getMetaData(); + int numCols = rsmd.getColumnCount(); + + for (int i = 1; i <= numCols; i++) { + result.addColumn(rsmd.getColumnLabel(i)); + } + + while (resultSet.next()) { + Map row = new HashMap(); + for (int i = 1; i <= numCols; i++) { + String columnName = result.getColumns().get(i - 1); + Object value = resultSet.getObject(i); + row.put(columnName, value); + } + result.addData(row); + } + } + } + catch (Exception e) { + String message = "Error executing statement: " + e.getMessage(); + log.error(message); + result.addError(message); + throw e; + } + finally { + closeStatement(statement); + } + } + rollback(); // Always rollback, as this is only intended to support querying + } + catch (Exception e) { + rollback(); + } + finally { + resetAutocommit(originalAutoCommit); + } + + return result; + } + + /** + * Executes a Sql Script + */ + public ResultSetIterator executeSqlToIterator(String sql, Map parameterValues) { + + ResultSetIterator iterator = null; + log.info("Executing SQL..."); + + List sqlStatements = new ArrayList(); + sqlStatements.addAll(parseParametersIntoStatements(parameterValues)); + sqlStatements.addAll(parseSqlIntoStatements(sql)); + + Boolean originalAutoCommit = null; + + try { + originalAutoCommit = connection.getAutoCommit(); + connection.setAutoCommit(false); + + for (String sqlStatement : sqlStatements) { + Statement statement = null; + try { + statement = connection.createStatement(); + // If is the last statement set setFetchSize + if (sqlStatement.equals(sqlStatements.get(sqlStatements.size() - 1))) { + statement.setFetchSize(10); + } + log.debug("Executing: {} " + sqlStatement); + statement.executeQuery(sqlStatement); + ResultSet resultSet = statement.getResultSet(); + + if (resultSet != null) { + iterator = new ResultSetIterator(resultSet); + } + } catch (Exception e) { + closeStatement(statement); + throw e; + } + } + } catch (Exception e) { + log.error("An error occurred while trying to execute the query.", e); + } finally { + resetAutocommit(originalAutoCommit); + } + + return iterator; + } + + protected void closeStatement(Statement statement) { + try { + if (statement != null) { + statement.close(); + } + } + catch (Exception e) { + log.warn("An error occurred while trying to close a statement", e); + } + } + + protected void commit() { + try { + connection.commit(); + } + catch (Exception e) { + log.warn("An error occurred while trying to commit", e); + } + } + + protected void rollback() { + try { + connection.rollback(); + } + catch (Exception e) { + log.warn("An error occurred while trying to rollback a connection", e); + } + } + + protected void resetAutocommit(Boolean autocommit) { + try { + if (autocommit != null) { + connection.setAutoCommit(autocommit); + } + } + catch (Exception e) { + log.warn("An error occurred while trying to reset autocommit to " + autocommit, e); + } + } + + /** + * @return a series of statements to set SQL variables based on the passed parameter values + */ + public List parseParametersIntoStatements(Map parameterValues) { + List statements = new ArrayList(); + if (parameterValues != null) { + for (String paramName : parameterValues.keySet()) { + Object paramValue = parameterValues.get(paramName); + String sqlVal = "null"; + if (paramValue != null) { + if (paramValue instanceof Date) { + sqlVal = "'" + DateUtil.formatDate((Date)paramValue, "yyyy-MM-dd") + "'"; + } + else if (paramValue instanceof Number || paramValue instanceof Boolean) { + sqlVal = paramValue.toString(); + } + else if (paramValue instanceof OpenmrsObject) { + sqlVal = ((OpenmrsObject)paramValue).getId().toString(); + } + else { + sqlVal = "'" + StringEscapeUtils.escapeSql(paramValue.toString()) + "'"; + } + } + statements.add("set @" + paramName + "=" + sqlVal); + } + } + return statements; + } + + + /** + * @return a List of statements that are parsed out of the passed sql, ignoring comments, and respecting delimiter assignment + */ + public List parseSqlIntoStatements(String sql) { + List statements = new ArrayList(); + StringBuilder currentStatement = new StringBuilder(); + + String currentDelimiter = getDelimiter(); + boolean inMultiLineComment = false; + + for (String line : sql.split("\\r?\\n")) { + + // First, trim the line and remove any trailing comments in the form of "statement; -- Comments here" + int delimiterIndex = line.indexOf(currentDelimiter); + int dashCommentIndex = line.indexOf("--"); + if (delimiterIndex > 0 && delimiterIndex < dashCommentIndex) { + line = line.substring(0, dashCommentIndex); + } + line = line.trim(); + + // Check to see if this line is within a multi-line comment, or if it ends a multi-line comment + if (inMultiLineComment) { + if (isEndOfMultiLineComment(line)) { + inMultiLineComment = false; + } + } + // If we are not within a multi-line comment, then process the line, if it is not a single line comment or empty space + else { + if (!isEmptyLine(line) && !isSingleLineComment(line)) { + + // If this line starts a multi-line comment, then ignore it and mark for next iteration + if (isStartOfMultiLineComment(line)) { + inMultiLineComment = true; + } + else { + // If the line is serving to set a new delimiter, set it and continue + String newDelimiter = getNewDelimiter(line); + if (newDelimiter != null) { + currentDelimiter = newDelimiter; + } + else { + // If we are here, that means that this line is part of an actual sql statement + if (line.endsWith(currentDelimiter)) { + line = line.substring(0, line.lastIndexOf(currentDelimiter)); + currentStatement.append(line); + statements.add(currentStatement.toString()); + currentStatement = new StringBuilder(); + } + else { + currentStatement.append(line).append("\n"); + } + } + } + } + } + } + if (currentStatement.length() > 0) { + statements.add(currentStatement.toString()); + } + return statements; + } + + //********** CONVENIENCE METHODS ************** + + protected boolean isEmptyLine(String line) { + return line == null || StringUtils.isBlank(line); + } + + protected boolean isSingleLineComment(String line) { + return line.startsWith("--") || line.startsWith("//") || (isStartOfMultiLineComment(line) && isEndOfMultiLineComment(line)); + } + + protected boolean isStartOfMultiLineComment(String line) { + return line.startsWith("/*"); + } + + protected boolean isEndOfMultiLineComment(String line) { + return line.endsWith("*/"); + } + + protected String getNewDelimiter(String line) { + Matcher matcher = DELIMITER_PATTERN.matcher(line); + if (matcher.matches()) { + return matcher.group(2); + } + return null; + } + + //************* PROPERTY ACCESS ******************* + + public Connection getConnection() { + return connection; + } + + public void setConnection(Connection connection) { + this.connection = connection; + } + + public String getDelimiter() { + return delimiter; + } + + public void setDelimiter(String delimiter) { + this.delimiter = delimiter; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/common/TimePeriod.java b/api/src/main/java/org/openmrs/module/reporting/common/TimePeriod.java index bc7cf25a53..3341f8b2f0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/TimePeriod.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/TimePeriod.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.common; import org.joda.time.Days; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/TimeQualifier.java b/api/src/main/java/org/openmrs/module/reporting/common/TimeQualifier.java index e1dde58e44..46b3246434 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/TimeQualifier.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/TimeQualifier.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/common/Timer.java b/api/src/main/java/org/openmrs/module/reporting/common/Timer.java index 05e9e408e1..98490f75f6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/Timer.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/Timer.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.common; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/common/VitalStatus.java b/api/src/main/java/org/openmrs/module/reporting/common/VitalStatus.java index b1d89577bd..4818057493 100644 --- a/api/src/main/java/org/openmrs/module/reporting/common/VitalStatus.java +++ b/api/src/main/java/org/openmrs/module/reporting/common/VitalStatus.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.common; diff --git a/api/src/main/java/org/openmrs/module/reporting/config/DataSetDescriptor.java b/api/src/main/java/org/openmrs/module/reporting/config/DataSetDescriptor.java new file mode 100644 index 0000000000..8686906481 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/DataSetDescriptor.java @@ -0,0 +1,57 @@ +package org.openmrs.module.reporting.config; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.ArrayList; +import java.util.List; + +public class DataSetDescriptor { + + @JsonProperty + private String key; + + @JsonProperty + private String type; + + @JsonProperty + private String config; + + @JsonProperty + private List parameters; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getConfig() { + return config; + } + + public void setConfig(String config) { + this.config = config; + } + + public List getParameters() { + if (parameters == null) { + parameters = new ArrayList(); + } + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/DesignDescriptor.java b/api/src/main/java/org/openmrs/module/reporting/config/DesignDescriptor.java new file mode 100644 index 0000000000..3f2710356c --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/DesignDescriptor.java @@ -0,0 +1,64 @@ +package org.openmrs.module.reporting.config; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.List; +import java.util.Map; + +public class DesignDescriptor { + + @JsonProperty + private String name; + + @JsonProperty + private String type; + + @JsonProperty + private String template; + + @JsonProperty + private Map properties; + + @JsonProperty + private List processors; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTemplate() { + return template; + } + + public void setTemplate(String template) { + this.template = template; + } + + public Map getProperties() { + return properties; + } + + public void setProperties(Map properties) { + this.properties = properties; + } + + public List getProcessors() { + return processors; + } + + public void setProcessors(List processors) { + this.processors = processors; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/ParameterDescriptor.java b/api/src/main/java/org/openmrs/module/reporting/config/ParameterDescriptor.java new file mode 100644 index 0000000000..6af071d006 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/ParameterDescriptor.java @@ -0,0 +1,74 @@ +package org.openmrs.module.reporting.config; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.Properties; + +public class ParameterDescriptor { + + @JsonProperty + private String key; + + @JsonProperty + private String type; + + @JsonProperty + private String label; + + @JsonProperty + private String value; + + @JsonProperty + private Boolean required; + + @JsonProperty + private Properties widgetConfiguration; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Boolean getRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public Properties getWidgetConfiguration() { + return widgetConfiguration; + } + + public void setWidgetConfiguration(Properties widgetConfiguration) { + this.widgetConfiguration = widgetConfiguration; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/ProcessorDescriptor.java b/api/src/main/java/org/openmrs/module/reporting/config/ProcessorDescriptor.java new file mode 100644 index 0000000000..a5d3b5e251 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/ProcessorDescriptor.java @@ -0,0 +1,76 @@ +package org.openmrs.module.reporting.config; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.util.Map; + +public class ProcessorDescriptor { + + @JsonProperty + private String name; + + @JsonProperty + private String type; + + @JsonProperty + private Boolean runOnSuccess; + + @JsonProperty + private Boolean runOnError; + + @JsonProperty + private String processorMode; + + @JsonProperty + private Map configuration; + + public ProcessorDescriptor() {} + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Boolean getRunOnSuccess() { + return runOnSuccess; + } + + public void setRunOnSuccess(Boolean runOnSuccess) { + this.runOnSuccess = runOnSuccess; + } + + public Boolean getRunOnError() { + return runOnError; + } + + public void setRunOnError(Boolean runOnError) { + this.runOnError = runOnError; + } + + public String getProcessorMode() { + return processorMode; + } + + public void setProcessorMode(String processorMode) { + this.processorMode = processorMode; + } + + public Map getConfiguration() { + return configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/ReportDescriptor.java b/api/src/main/java/org/openmrs/module/reporting/config/ReportDescriptor.java new file mode 100644 index 0000000000..0fff269880 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/ReportDescriptor.java @@ -0,0 +1,109 @@ +package org.openmrs.module.reporting.config; + +import org.codehaus.jackson.annotate.JsonProperty; + +import java.io.File; +import java.util.List; +import java.util.Map; + +public class ReportDescriptor { + + @JsonProperty + private String key; + + @JsonProperty + private String uuid; + + @JsonProperty + private String name; + + @JsonProperty + private String description; + + @JsonProperty + private List parameters; + + @JsonProperty + private List datasets; + + @JsonProperty + private List designs; + + @JsonProperty + private Map config; + + // utility property for storing the path to this descriptor on the file system so we know where to look for related files + private File path; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public List getDatasets() { + return datasets; + } + + public void setDatasets(List datasets) { + this.datasets = datasets; + } + + public List getDesigns() { + return designs; + } + + public void setDesigns(List designs) { + this.designs = designs; + } + + public Map getConfig() { + return config; + } + + public void setConfig(Map config) { + this.config = config; + } + + public File getPath() { + return path; + } + + public void setPath(File path) { + this.path = path; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/ReportLoader.java b/api/src/main/java/org/openmrs/module/reporting/config/ReportLoader.java new file mode 100644 index 0000000000..d7c55ac9a4 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/ReportLoader.java @@ -0,0 +1,430 @@ +package org.openmrs.module.reporting.config; + + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.filefilter.FileFilterUtils; +import org.apache.commons.io.filefilter.TrueFileFilter; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.Location; +import org.openmrs.api.context.Context; +import org.openmrs.api.db.SerializedObject; +import org.openmrs.api.db.SerializedObjectDAO; +import org.openmrs.module.reporting.common.ContentType; +import org.openmrs.module.reporting.common.ObjectUtil; +import org.openmrs.module.reporting.config.factory.DataSetFactory; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.evaluation.parameter.Mapped; +import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.module.reporting.report.ReportDesign; +import org.openmrs.module.reporting.report.ReportDesignResource; +import org.openmrs.module.reporting.report.ReportProcessorConfiguration; +import org.openmrs.module.reporting.report.definition.ReportDefinition; +import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; +import org.openmrs.module.reporting.report.processor.DiskReportProcessor; +import org.openmrs.module.reporting.report.processor.EmailReportProcessor; +import org.openmrs.module.reporting.report.processor.LoggingReportProcessor; +import org.openmrs.module.reporting.report.renderer.CsvReportRenderer; +import org.openmrs.module.reporting.report.renderer.ReportDesignRenderer; +import org.openmrs.module.reporting.report.renderer.ReportRenderer; +import org.openmrs.module.reporting.report.renderer.XlsReportRenderer; +import org.openmrs.module.reporting.report.service.ReportService; +import org.openmrs.util.OpenmrsUtil; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; + +public class ReportLoader { + + private static Log log = LogFactory.getLog(ReportLoader.class); + + public static final String getReportingDescriptorsConfigurationDir() { + return OpenmrsUtil.getApplicationDataDirectory() + File.separator + "configuration" + File.separator + "reports" + File.separator + "reportdescriptors"; + } + + public static void loadReportsFromConfig() { + for (ReportDescriptor reportDescriptor : loadReportDescriptors()) { + loadReportFromDescriptor(reportDescriptor); + } + } + + public static void loadReportFromDescriptor(ReportDescriptor reportDescriptor) { + ReportDefinition reportDefinition = constructReportDefinition(reportDescriptor); + saveReportDefinition(reportDefinition); + List reportDesigns = constructReportDesigns(reportDefinition, reportDescriptor); + saveReportDesigns(reportDefinition, reportDesigns); + } + + public static void saveReportDefinition(ReportDefinition reportDefinition) { + + ReportDefinition existing = Context.getService(ReportDefinitionService.class).getDefinitionByUuid(reportDefinition.getUuid()); + if (existing != null) { + // we need to overwrite the existing, rather than purge-and-recreate, to avoid deleting old ReportRequests + reportDefinition.setId(existing.getId()); + } + else { + // incompatible class changes for a serialized object could mean that getting the definition return null + // and some serialization error gets logged. In that case we want to overwrite the invalid serialized definition + SerializedObject invalidSerializedObject = Context.getRegisteredComponents(SerializedObjectDAO.class).get(0).getSerializedObjectByUuid(reportDefinition.getUuid()); + if (invalidSerializedObject != null) { + reportDefinition.setId(invalidSerializedObject.getId()); + } + } + + Context.getService(ReportDefinitionService.class).saveDefinition(reportDefinition); + } + + public static void saveReportDesigns(ReportDefinition reportDefinition, List reportDesigns) { + // purging a ReportDesign doesn't trigger any extra logic, so we can just purge-and-recreate here + List existingDesigns = Context.getService(ReportService.class).getReportDesigns(reportDefinition, null, true); + if (existingDesigns.size() > 0) { + log.debug("Deleting " + existingDesigns.size() + " old designs for " + reportDefinition.getName()); + for (ReportDesign design : existingDesigns) { + Context.getService(ReportService.class).purgeReportDesign(design); + } + } + + for (ReportDesign reportDesign : reportDesigns) { + Context.getService(ReportService.class).saveReportDesign(reportDesign); + } + } + + public static ReportDefinition constructReportDefinition(ReportDescriptor reportDescriptor) { + ReportDefinition rd = new ReportDefinition(); + rd.setName(reportDescriptor.getName()); + rd.setDescription(reportDescriptor.getDescription()); + rd.setUuid(reportDescriptor.getUuid()); + rd.setParameters(constructParameters(reportDescriptor.getParameters())); + + if (reportDescriptor.getDatasets() != null) { + for (DataSetDescriptor dataSetDescriptor : reportDescriptor.getDatasets()) { + addDataSetDefinition(rd, dataSetDescriptor, reportDescriptor.getPath()); + } + } + return rd; + } + + public static List constructParameters(List parameterDescriptors) { + List parameters = new ArrayList(); + if (parameterDescriptors != null) { + for (ParameterDescriptor parameterDescriptor : parameterDescriptors) { + try { + Class parameterType = getParameterClass(parameterDescriptor.getType()); + Parameter p = new Parameter(); + p.setName(parameterDescriptor.getKey()); + p.setLabel(parameterDescriptor.getLabel()); + p.setType(parameterType); + p.setDefaultValue(getParameterValue(parameterType, parameterDescriptor.getValue())); + p.setRequired(BooleanUtils.isNotFalse(parameterDescriptor.getRequired())); + p.setWidgetConfiguration(parameterDescriptor.getWidgetConfiguration()); + parameters.add(p); + } catch (Exception e) { + throw new RuntimeException("Unable to configure parameter " + parameterDescriptor.getKey(), e); + } + } + } + return parameters; + } + + public static Class getParameterClass(String clazz) throws ClassNotFoundException { + if (clazz == null) { + return String.class; + } + if (clazz.equalsIgnoreCase("location")) { + return Location.class; + } + else if (clazz.equalsIgnoreCase("date")) { + return Date.class; + } + else if (clazz.equalsIgnoreCase("text") || clazz.equalsIgnoreCase("string")) { + return String.class; + } + else if (clazz.equalsIgnoreCase("locale")) { + return Locale.class; + } + else { + return Context.loadClass(clazz); + } + } + + public static Object getParameterValue(Class parameterType, String stringVal) { + Object ret = null; + try { + if (stringVal != null) { + if (parameterType == String.class) { + return stringVal; + } + else if (parameterType == Date.class) { + return new SimpleDateFormat("yyyy-MM-dd").parse(stringVal); + } + else if (parameterType == Locale.class) { + return new Locale(stringVal); + } + else { + throw new IllegalStateException("Unable to parse parameter values of type " + parameterType); + } + } + } + catch (Exception e) { + throw new IllegalStateException("Unable to parse parameter value " + stringVal + " to a " + parameterType); + } + return ret; + } + + public static void addDataSetDefinition(ReportDefinition rd, DataSetDescriptor dataSetDescriptor, File path) { + + Mapped mappedDsd = new Mapped(); + + String factoryBeanName = dataSetDescriptor.getType(); + if ("sql".equalsIgnoreCase(factoryBeanName)) { + factoryBeanName = "sqlDataSetFactory"; + } + + DataSetFactory factory = Context.getRegisteredComponent(factoryBeanName, DataSetFactory.class); + if (factory == null) { + throw new RuntimeException("Unsupported data set descriptor type: " + dataSetDescriptor.getType()); + } + DataSetDefinition dsd = factory.constructDataSetDefinition(dataSetDescriptor, path); + mappedDsd.setParameterizable(dsd); + + // First add in all of the report parameters + for (Parameter reportParameter : rd.getParameters()) { + Parameter parameter = new Parameter(reportParameter); + mappedDsd.getParameterizable().addParameter(parameter); + if (parameter.getDefaultValue() != null) { + mappedDsd.addParameterMapping(parameter.getName(), parameter.getDefaultValue()); + parameter.setDefaultValue(null); + } else { + mappedDsd.addParameterMapping(parameter.getName(), "${" + parameter.getName() + "}"); + } + } + + // Next, if any data set parameters specify values for report parameters, or are new parameters, add these + List datasetParameters = constructParameters(dataSetDescriptor.getParameters()); + for (Parameter parameter : datasetParameters) { + boolean found = false; + for (Parameter existingParam : rd.getParameters()) { + if (existingParam.getName().equals(parameter.getName())) { + found = true; + if (parameter.getDefaultValue() != null) { + mappedDsd.getParameterMappings().put(existingParam.getName(), parameter.getDefaultValue()); + parameter.setDefaultValue(null); + } + } + } + if (!found) { + mappedDsd.getParameterizable().addParameter(parameter); + if (parameter.getDefaultValue() != null) { + mappedDsd.addParameterMapping(parameter.getName(), parameter.getDefaultValue()); + parameter.setDefaultValue(null); + } + } + } + + rd.addDataSetDefinition(dataSetDescriptor.getKey(), mappedDsd); + } + + public static List constructReportDesigns(ReportDefinition reportDefinition, ReportDescriptor reportDescriptor) { + + List reportDesigns = new ArrayList(); + + // always do a default CSV design, if no designs are explicitly configured + if (reportDescriptor.getDesigns() == null || reportDescriptor.getDesigns().size() == 0) { + DesignDescriptor defaultDesignDescriptor = new DesignDescriptor(); + defaultDesignDescriptor.setType("csv"); + reportDescriptor.setDesigns(Collections.singletonList(defaultDesignDescriptor)); + } + + for (DesignDescriptor designDescriptor : reportDescriptor.getDesigns()) { + ReportDesign design; + if (designDescriptor.getType().equalsIgnoreCase("csv")) { + design = constructCSVReportDesign(reportDefinition); + } + else if (designDescriptor.getType().equalsIgnoreCase("excel") || designDescriptor.getType().equalsIgnoreCase("xls")) { + design = constructXlsReportDesign(reportDefinition, reportDescriptor, designDescriptor); + } + else { + try { + design = new ReportDesign(); + design.setName(designDescriptor.getName()); + design.setReportDefinition(reportDefinition); + design.setRendererType((Class)Context.loadClass(designDescriptor.getType())); + + if (StringUtils.isNotBlank(designDescriptor.getTemplate())) { + String template = designDescriptor.getTemplate(); + ReportDesignResource resource = new ReportDesignResource(); + resource.setName("template"); + for (ContentType contentType : ContentType.values()) { + if (template.toLowerCase().endsWith("." + contentType.getExtension())) { + resource.setExtension(contentType.getExtension()); + resource.setContentType(contentType.getContentType()); + } + } + File templateFile = new File(reportDescriptor.getPath(), template); + + byte[] templateBytes = FileUtils.readFileToByteArray(templateFile); + resource.setContents(templateBytes); + resource.setReportDesign(design); + design.addResource(resource); + } + } + catch (Exception e) { + throw new RuntimeException("Failed to load report design: " + designDescriptor.getType() + " for report " + reportDefinition.getName(), e); + } + } + + if (designDescriptor.getProperties() != null) { + for (Map.Entry property : designDescriptor.getProperties().entrySet()) { + design.addPropertyValue(property.getKey(), property.getValue()); + } + } + + if (design.getPropertyValue(ReportDesignRenderer.FILENAME_BASE_PROPERTY, null) == null) { + design.addPropertyValue(ReportDesignRenderer.FILENAME_BASE_PROPERTY, StringUtils.replace(reportDefinition.getName(), " ", ".").toLowerCase() + "." + + "{{ formatDate request.reportDefinition.parameterMappings.startDate \"yyyyMMdd\" }}." + + "{{ formatDate request.reportDefinition.parameterMappings.endDate \"yyyyMMdd\" }}." + + "{{ formatDate request.evaluateStartDatetime \"yyyyMMdd\" }}." + + "{{ formatDate request.evaluateStartDatetime \"HHmm\" }}"); + } + + if (designDescriptor.getProcessors() != null) { + for (ProcessorDescriptor processorDescriptor : designDescriptor.getProcessors()) { + ReportProcessorConfiguration c = new ReportProcessorConfiguration(); + String type = processorDescriptor.getType(); + if ("disk".equalsIgnoreCase(type)) { + type = DiskReportProcessor.class.getName(); + } + else if ("email".equalsIgnoreCase(type)) { + type = EmailReportProcessor.class.getName(); + } + else if ("logging".equalsIgnoreCase(type)) { + type = LoggingReportProcessor.class.getName(); + } + c.setProcessorType(type); + c.setRunOnSuccess(processorDescriptor.getRunOnSuccess()); + c.setRunOnError(processorDescriptor.getRunOnError()); + c.setName(processorDescriptor.getName()); + if (processorDescriptor.getProcessorMode() != null) { + c.setProcessorMode(ReportProcessorConfiguration.ProcessorMode.valueOf(processorDescriptor.getProcessorMode())); + } + c.setReportDesign(design); + if (processorDescriptor.getConfiguration() != null) { + c.setConfiguration(new Properties()); + for (Map.Entry config : processorDescriptor.getConfiguration().entrySet()) { + String configValue = config.getValue(); + configValue = configValue.replace("{{application_data_directory}}", OpenmrsUtil.getApplicationDataDirectory()); + c.getConfiguration().setProperty(config.getKey(), configValue); + } + } + design.addReportProcessor(c); + } + } + + reportDesigns.add(design); + } + + return reportDesigns; + } + + public static ReportDesign constructCSVReportDesign(ReportDefinition reportDefinition) { + ReportDesign design = new ReportDesign(); + design.setName("reporting.csv"); + design.setReportDefinition(reportDefinition); + design.setRendererType(CsvReportRenderer.class); + return design; + } + + public static ReportDesign constructXlsReportDesign(ReportDefinition reportDefinition, ReportDescriptor reportDescriptor, DesignDescriptor designDescriptor) { + + ReportDesign design = new ReportDesign(); + design.setName(ObjectUtil.nvlStr(designDescriptor.getName(), "reporting.excel")); + design.setReportDefinition(reportDefinition); + design.setRendererType(XlsReportRenderer.class); + + if (StringUtils.isNotBlank(designDescriptor.getTemplate())) { + ReportDesignResource resource = new ReportDesignResource(); + resource.setName("template"); + resource.setExtension(ContentType.EXCEL.getExtension()); + resource.setContentType(ContentType.EXCEL.getContentType()); + + try { + File templateFile = new File(reportDescriptor.getPath(), designDescriptor.getTemplate()); + byte[] excelTemplate = IOUtils.toByteArray(new FileInputStream(templateFile)); + resource.setContents(excelTemplate); + } catch (IOException e) { + throw new RuntimeException("Failed to load XLS template " + designDescriptor.getTemplate(), e); + } + resource.setReportDesign(design); + design.addResource(resource); + } + + + return design; + } + + public static List loadReportDescriptors() { + List reportDescriptors = new ArrayList(); + Collection files = null; + + try { + File reportDir = new File(getReportingDescriptorsConfigurationDir()); + if (reportDir.exists()) { + // search all directories and subdirectories for YAML files + files = FileUtils.listFiles(reportDir, FileFilterUtils.suffixFileFilter("yml"), TrueFileFilter.INSTANCE); + } + } + catch (Exception e) { + throw new RuntimeException("Unable to open reporting configuration directory", e); + } + + if (files != null) { + for (File file : files) { + reportDescriptors.add(ReportLoader.load(file)); + } + } + + return reportDescriptors; + } + + public static ReportDescriptor load(File file) { + + ReportDescriptor reportDescriptor = null; + + ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); + + if (file.exists()) { + + InputStream is = null; + + try { + is = new FileInputStream(file); + reportDescriptor = objectMapper.readValue(is, ReportDescriptor.class); + reportDescriptor.setPath(file.getParentFile()); + } + catch (Exception e) { + throw new RuntimeException("Unable to load report descriptor " + file.getAbsolutePath(), e); + } + finally { + IOUtils.closeQuietly(is); + } + } + + return reportDescriptor; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/factory/DataSetFactory.java b/api/src/main/java/org/openmrs/module/reporting/config/factory/DataSetFactory.java new file mode 100644 index 0000000000..75227fd80f --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/factory/DataSetFactory.java @@ -0,0 +1,24 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.config.factory; + +import org.openmrs.module.reporting.config.DataSetDescriptor; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; + +import java.io.File; + +/** + * Interface for providers that are capable of constructing and returning new DataSetDefinition instances from config + */ +public interface DataSetFactory { + + DataSetDefinition constructDataSetDefinition(DataSetDescriptor dataSetDescriptor, File baseConfigDir); + +} diff --git a/api/src/main/java/org/openmrs/module/reporting/config/factory/SqlDataSetFactory.java b/api/src/main/java/org/openmrs/module/reporting/config/factory/SqlDataSetFactory.java new file mode 100644 index 0000000000..327e073458 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/config/factory/SqlDataSetFactory.java @@ -0,0 +1,35 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.config.factory; + +import org.openmrs.module.reporting.config.DataSetDescriptor; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.SqlFileDataSetDefinition; +import org.springframework.stereotype.Component; + +import java.io.File; + +/** + * Builds a SqlFileDataSetDefinition from configuration + */ +@Component +public class SqlDataSetFactory implements DataSetFactory { + + public DataSetDefinition constructDataSetDefinition(DataSetDescriptor dataSetDescriptor, File baseConfigDir) { + File sqlFile = new File(baseConfigDir, dataSetDescriptor.getConfig()); + if (!sqlFile.exists()) { + throw new RuntimeException("SQL file " + dataSetDescriptor.getConfig() + " not found"); + } + SqlFileDataSetDefinition dsd = new SqlFileDataSetDefinition(); + dsd.setSqlFile(sqlFile.getAbsolutePath()); + return dsd; + } + +} diff --git a/api/src/main/java/org/openmrs/module/reporting/data/BaseData.java b/api/src/main/java/org/openmrs/module/reporting/data/BaseData.java index 0fd52bd5da..eeeb8820fd 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/BaseData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/BaseData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/BaseDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/BaseDataDefinition.java index f6f9d1a38c..4bb31d2daa 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/BaseDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/BaseDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/BaseDefinitionLibraryDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/BaseDefinitionLibraryDataDefinition.java index e4a3e7bad1..3836fa367c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/BaseDefinitionLibraryDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/BaseDefinitionLibraryDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data; import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/BaseSqlDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/BaseSqlDataDefinition.java index a19a2cc970..407b6183eb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/BaseSqlDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/BaseSqlDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/ConvertedDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/ConvertedDataDefinition.java index 23a80bd20c..312616f452 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/ConvertedDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/ConvertedDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/Data.java b/api/src/main/java/org/openmrs/module/reporting/data/Data.java index 9e92f68b8b..7db13e2278 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/Data.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/Data.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/DataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/DataDefinition.java index 08386d3c4b..f40ea19e86 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/DataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/DataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/DataSetDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/DataSetDataDefinition.java index 1d62af1a4f..c3ca607601 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/DataSetDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/DataSetDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/DataUtil.java b/api/src/main/java/org/openmrs/module/reporting/data/DataUtil.java index bac8ca7552..17d86ac8b5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/DataUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/DataUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/JoinDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/JoinDataDefinition.java index 7592b95bfd..4359ae2a45 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/JoinDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/JoinDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/MappedData.java b/api/src/main/java/org/openmrs/module/reporting/data/MappedData.java index 53ec4cc985..c8f4fd28f0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/MappedData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/MappedData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeConverter.java index fffbe337e7..6fccf481e9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeRangeConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeRangeConverter.java index ded1cd33f8..9284b77b04 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeRangeConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/AgeRangeConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/AttributeValueConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/AttributeValueConverter.java index f7cc906004..3d44051406 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/AttributeValueConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/AttributeValueConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateConverter.java index c84e5bc129..67f924cf67 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverter.java index 5259d63630..22c39c4d9c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/BirthdateToAgeConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/BooleanConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/BooleanConverter.java index 77cb802dbc..fefd19f1d3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/BooleanConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/BooleanConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ChainedConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ChainedConverter.java index 0428ec6ff3..b0c5324712 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ChainedConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ChainedConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ChangeInValueConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ChangeInValueConverter.java index b70fcd73a7..7d6d8badaf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ChangeInValueConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ChangeInValueConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionConverter.java index 57a01a7073..d24183ec97 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionElementConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionElementConverter.java index b22815bf68..0e04ced328 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionElementConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/CollectionElementConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import java.util.Collection; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ConcatenatedPropertyConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ConcatenatedPropertyConverter.java index ea2a8c112d..37e65d104a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ConcatenatedPropertyConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ConcatenatedPropertyConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ConceptCodeFromConceptConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ConceptCodeFromConceptConverter.java index 489b847b12..eafed53769 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ConceptCodeFromConceptConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ConceptCodeFromConceptConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.openmrs.Concept; @@ -8,6 +17,8 @@ public class ConceptCodeFromConceptConverter implements DataConverter { private String conceptSourceName; + public ConceptCodeFromConceptConverter() {}; + public ConceptCodeFromConceptConverter(String conceptSourceName) { this.conceptSourceName = conceptSourceName; } diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/CountConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/CountConverter.java index b30788916e..8fd694f0f7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/CountConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/CountConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import java.util.Collection; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/DataConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/DataConverter.java index 78b1b1e9a5..327ad02981 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/DataConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/DataConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/DataSetRowConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/DataSetRowConverter.java index 82ece307ea..2a89367665 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/DataSetRowConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/DataSetRowConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/DateConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/DateConverter.java index 19e29b1a75..3eda3b05af 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/DateConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/DateConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/EarliestCreatedConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/EarliestCreatedConverter.java index 5cefa73ff8..fa9e498860 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/EarliestCreatedConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/EarliestCreatedConverter.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.converter; import org.openmrs.Auditable; @@ -27,6 +22,10 @@ public class EarliestCreatedConverter implements DataConverter { private Class typeOfItem; + public EarliestCreatedConverter() { + + } + public EarliestCreatedConverter(Class typeOfItem) { this.typeOfItem = typeOfItem; } diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ExistenceConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ExistenceConverter.java index 6b794338e5..5ef83672e6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ExistenceConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ExistenceConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ListConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ListConverter.java index d4f5626055..73228537b5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ListConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ListConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/MapConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/MapConverter.java index 541365de12..32d84a569e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/MapConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/MapConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/MapElementConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/MapElementConverter.java index 686c90d27d..ad60d3ba5b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/MapElementConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/MapElementConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/MostRecentlyCreatedConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/MostRecentlyCreatedConverter.java index 979be08989..7bc3ebbd56 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/MostRecentlyCreatedConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/MostRecentlyCreatedConverter.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.converter; import org.openmrs.Auditable; @@ -26,6 +21,10 @@ public class MostRecentlyCreatedConverter implements DataConverter { private Class typeOfItem; + public MostRecentlyCreatedConverter() { + + }; + public MostRecentlyCreatedConverter(Class typeOfItem) { this.typeOfItem = typeOfItem; } diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/NullValueConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/NullValueConverter.java index a28afeb682..c1c27630ca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/NullValueConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/NullValueConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObjectFormatter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObjectFormatter.java index b5ee93167b..991edc8fad 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObjectFormatter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObjectFormatter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverter.java index 604fb78bf7..02e90ae685 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsFromObsGroupConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.openmrs.Concept; @@ -7,6 +16,8 @@ public class ObsFromObsGroupConverter implements DataConverter { private Concept concept; + public ObsFromObsGroupConverter() {}; + public ObsFromObsGroupConverter(Concept concept) { this.concept = concept; } diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueConverter.java index 6e8c75a569..180d29e3ce 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverter.java index c85d58ed08..b69215a2c9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/ObsValueTextAsCodedConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.apache.commons.lang3.StringUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverter.java index 523a6a7adf..7dd7d5efdf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/PrivilegedDataConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.converter; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/PropertyConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/PropertyConverter.java index 9ed3fc67d3..82bc7fabca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/PropertyConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/PropertyConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/converter/StringConverter.java b/api/src/main/java/org/openmrs/module/reporting/data/converter/StringConverter.java index 4f2f394889..f9a4f19d89 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/converter/StringConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/converter/StringConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterData.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterData.java index cb298e983a..ade8d3b038 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterDataUtil.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterDataUtil.java index a84188c741..68cf4b72e0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterDataUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EncounterDataUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EvaluatedEncounterData.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EvaluatedEncounterData.java index 843e40258c..8007499a55 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/EvaluatedEncounterData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/EvaluatedEncounterData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AgeAtEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AgeAtEncounterDataDefinition.java index 999f08ac95..c8f22cf0d6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AgeAtEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AgeAtEncounterDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.module.reporting.common.Age; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AuditInfoEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AuditInfoEncounterDataDefinition.java index 13095fd7ea..9fdc8a2740 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AuditInfoEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/AuditInfoEncounterDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.module.reporting.common.AuditInfo; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ConvertedEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ConvertedEncounterDataDefinition.java index 2866f0bfb5..0b11bbbd77 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ConvertedEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ConvertedEncounterDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataDefinition.java index 07740ece99..f7cb03b4c1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataSetDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataSetDataDefinition.java index c1f1934362..955744e315 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataSetDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDataSetDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDatetimeDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDatetimeDataDefinition.java index a6768950d5..4b83d8e829 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDatetimeDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterDatetimeDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterFormDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterFormDataDefinition.java index 3676568851..3f25e67f27 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterFormDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterFormDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterIdDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterIdDataDefinition.java index a2e72ef7cd..e87614ee00 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterIdDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterIdDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterLocationDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterLocationDataDefinition.java index 569e509e78..3599c66272 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterLocationDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterLocationDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterProviderDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterProviderDataDefinition.java index 0dda4a4603..5c49d1c6d7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterProviderDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterProviderDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterTypeDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterTypeDataDefinition.java index ce4a09eee2..3dd7a5acb4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterTypeDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterTypeDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterVisitDataDefinition.java index 26cd82682f..56b29947cb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/EncounterVisitDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.Visit; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsForEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsForEncounterDataDefinition.java index b953128d26..408cf217a1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsForEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsForEncounterDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.Concept; @@ -7,6 +16,7 @@ import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy; import org.openmrs.module.reporting.evaluation.caching.Caching; +import java.util.ArrayList; import java.util.List; /** @@ -21,6 +31,9 @@ public class ObsForEncounterDataDefinition extends BaseDataDefinition implements @ConfigurationProperty private Concept question; + @ConfigurationProperty + private List answers; // Only returns Obs with the following coded answer values + @ConfigurationProperty private boolean singleObs = true; @@ -40,6 +53,21 @@ public void setQuestion(Concept question) { this.question = question; } + public List getAnswers() { + return answers; + } + + public void setAnswers(List answers) { + this.answers = answers; + } + + public void addAnswer(Concept answer) { + if (answers == null) { + answers = new ArrayList(); + } + answers.add(answer); + } + public boolean isSingleObs() { return singleObs; } diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsOnSameDateEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsOnSameDateEncounterDataDefinition.java new file mode 100644 index 0000000000..8ac7383b17 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/ObsOnSameDateEncounterDataDefinition.java @@ -0,0 +1,22 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.data.encounter.definition; + +import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy; +import org.openmrs.module.reporting.evaluation.caching.Caching; + +/** + * Column of a specific obs or set of obs associated with an encounter based on the question concept + * associated with the obs + */ +@Caching(strategy=ConfigurationPropertyCachingStrategy.class) +public class ObsOnSameDateEncounterDataDefinition extends ObsForEncounterDataDefinition { + +} diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PatientToEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PatientToEncounterDataDefinition.java index 04d0279707..64cf67d4ef 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PatientToEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PatientToEncounterDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PersonToEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PersonToEncounterDataDefinition.java index bf1a25be75..8004939e51 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PersonToEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/PersonToEncounterDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SimultaneousEncountersDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SimultaneousEncountersDataDefinition.java index 98e11ebdf3..7cdd1e7431 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SimultaneousEncountersDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SimultaneousEncountersDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SqlEncounterDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SqlEncounterDataDefinition.java index c95218b202..caec1691db 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SqlEncounterDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/definition/SqlEncounterDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.definition; import org.openmrs.module.reporting.data.BaseSqlDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluator.java index 2bc848c504..07ce8ed8bb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AgeAtEncounterDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluator.java index 29aae375a4..cbd7856d37 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/AuditInfoEncounterDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluator.java index 18ca3a9139..450aaa40da 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ConvertedEncounterDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDataEvaluator.java index 22299dd8cd..8f1c81ded8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDatetimeDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDatetimeDataEvaluator.java index b2a5b092e3..e3a89741f8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDatetimeDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterDatetimeDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluator.java index 6e5ffcb191..49545d1676 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterIdDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluator.java index e4d5352867..99cfe182e7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterLocationDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterPropertyDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterPropertyDataEvaluator.java index a25ab45572..bc7314d173 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterPropertyDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterPropertyDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluator.java index 6deb55f079..3dd6bed141 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterProviderDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterTypeDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterTypeDataEvaluator.java index 382e8f13c0..4de60cb06d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterTypeDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterTypeDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluator.java index 2f88e1fc35..9d982358b3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/EncounterVisitDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterDataEvaluator.java index f0eeafbc4b..e7b627da0c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsForEncounterDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.encounter.evaluator; import org.apache.commons.logging.Log; @@ -34,6 +43,7 @@ public EvaluatedEncounterData evaluate(EncounterDataDefinition definition, Evalu q.select("obs.encounter.encounterId, obs"); q.from(Obs.class, "obs"); q.whereEqual("obs.concept", def.getQuestion()); + q.whereIn("obs.valueCoded", def.getAnswers()); q.whereEncounterIn("obs.encounter.encounterId", context); List result = Context.getService(EvaluationService.class).evaluateToList(q, context); diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluator.java new file mode 100644 index 0000000000..9824520c46 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/ObsOnSameDateEncounterDataEvaluator.java @@ -0,0 +1,114 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.data.encounter.evaluator; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.Encounter; +import org.openmrs.Obs; +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.common.DateUtil; +import org.openmrs.module.reporting.data.encounter.EvaluatedEncounterData; +import org.openmrs.module.reporting.data.encounter.definition.EncounterDataDefinition; +import org.openmrs.module.reporting.data.encounter.definition.ObsOnSameDateEncounterDataDefinition; +import org.openmrs.module.reporting.data.encounter.service.EncounterDataService; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.EvaluationException; +import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Evaluates a ObsOnSameDateEncounterDataDefinition to produce EncounterData + */ +@Handler(supports=ObsOnSameDateEncounterDataDefinition.class, order=40) +public class ObsOnSameDateEncounterDataEvaluator implements EncounterDataEvaluator { + + protected final Log log = LogFactory.getLog(getClass()); + + @Autowired + EncounterDataService encounterDataService; + + @Autowired + EvaluationService evaluationService; + + @Override + public EvaluatedEncounterData evaluate(EncounterDataDefinition definition, EvaluationContext context) throws EvaluationException { + + ObsOnSameDateEncounterDataDefinition def = (ObsOnSameDateEncounterDataDefinition) definition; + EvaluatedEncounterData data = new EvaluatedEncounterData(); + + // First get a Map from encounterId to patient:date + + HqlQueryBuilder encQuery = new HqlQueryBuilder(); + encQuery.select("encounter.encounterId, encounter.patient.patientId, encounter.encounterDatetime"); + encQuery.from(Encounter.class, "encounter"); + encQuery.whereEncounterIn("encounter.encounterId", context); + List encounterData = evaluationService.evaluateToList(encQuery, context); + + Map encounterToDateMap = new HashMap(); + Set pIds = new HashSet(); + for (Object[] enc : encounterData) { + Integer encId = (Integer)enc[0]; + Integer pId = (Integer)enc[1]; + String encDate = DateUtil.formatDate((Date)enc[2], "yyyyMMdd"); + encounterToDateMap.put(encId, pId + ":" + encDate); + pIds.add(pId); + } + + // Next get a Map from patient:date to List + + HqlQueryBuilder obsQuery = new HqlQueryBuilder(); + obsQuery.select("obs.encounter.patient.patientId, obs.encounter.encounterDatetime, obs"); + obsQuery.from(Obs.class, "obs"); + obsQuery.whereEqual("obs.concept", def.getQuestion()); + obsQuery.whereIn("obs.valueCoded", def.getAnswers()); + obsQuery.whereIdIn("obs.encounter.patient.patientId", pIds); + obsQuery.orderDesc("obs.obsDatetime"); + List obsData = evaluationService.evaluateToList(obsQuery, context); + + Map> dateToObsMap = new HashMap>(); + for (Object[] obs : obsData) { + Integer pId = (Integer)obs[0]; + String encDate = DateUtil.formatDate((Date)obs[1], "yyyyMMdd"); + String dateKey = pId + ":" + encDate; + List l = dateToObsMap.get(dateKey); + if (l == null) { + l = new ArrayList(); + dateToObsMap.put(dateKey, l); + } + l.add((Obs)obs[2]); + } + + // Finally, join those together to get a Map from encounterId to List + + for (Integer encId : encounterToDateMap.keySet()) { + String dateKey = encounterToDateMap.get(encId); + List obsList = dateToObsMap.get(dateKey); + + if (def.isSingleObs() && (obsList != null)) { + // return only the most recent Obs + data.addData(encId, obsList.get(0)); + } else { + data.addData(encId, obsList); + } + } + + return data; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluator.java index 6ba2a94fd2..88a148be95 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PatientToEncounterDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluator.java index dce25714db..b8fa427961 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/PersonToEncounterDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluator.java index 637ed8ad77..9592a8547e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SimultaneousEncountersDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluator.java index f550bd0935..ed07724974 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/evaluator/SqlEncounterDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibrary.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibrary.java index 80d6d0cb5d..af0543aa9d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/library/BuiltInEncounterDataLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.encounter.library; import org.openmrs.module.reporting.common.AuditInfo; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/persister/SerializedEncounterDataPersister.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/persister/SerializedEncounterDataPersister.java index f73f64a207..595979e127 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/persister/SerializedEncounterDataPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/persister/SerializedEncounterDataPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataService.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataService.java index f9c599649b..446f958ab2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataService.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImpl.java index 51c4041254..b11a9ca3a4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/encounter/service/EncounterDataServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.encounter.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/EvaluatedObsData.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/EvaluatedObsData.java index f036f04853..39164bdf6f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/EvaluatedObsData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/EvaluatedObsData.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.obs; import org.openmrs.module.reporting.data.obs.definition.ObsDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsData.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsData.java index d8a99eb643..f601260081 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsDataUtil.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsDataUtil.java index f79019b138..993fde9c05 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsDataUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/ObsDataUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ConvertedObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ConvertedObsDataDefinition.java index 97870a1b18..bd5a9f7e27 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ConvertedObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ConvertedObsDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.ConvertedDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/EncounterToObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/EncounterToObsDataDefinition.java index b90bccb9f3..c881d1c3c0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/EncounterToObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/EncounterToObsDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.JoinDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/GroupMemberObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/GroupMemberObsDataDefinition.java index 160f8f9ee7..a83f947c7a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/GroupMemberObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/GroupMemberObsDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.Concept; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsDataDefinition.java index 2be865e8fb..6d1090ef33 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.DataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsIdDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsIdDataDefinition.java index 4695823318..2cdb9c4edf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsIdDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/ObsIdDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.BaseDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PatientToObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PatientToObsDataDefinition.java index 6f0467a30c..f9dadf329f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PatientToObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PatientToObsDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.JoinDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PersonToObsDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PersonToObsDataDefinition.java index 53fb4dfc6a..688ff16a4a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PersonToObsDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/definition/PersonToObsDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.definition; import org.openmrs.module.reporting.data.JoinDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluator.java index 22f0259bf6..252a50d96a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ConvertedObsDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluator.java index ae8dea5487..fbfad8909c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/EncounterToObsDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluator.java index 505352c7d8..2cf033df50 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/GroupMemberObsDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsDataEvaluator.java index e254a01fc3..b2d7bbc805 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.module.reporting.data.obs.EvaluatedObsData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluator.java index d0a86a1d1d..833ba4abad 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsIdDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsPropertyDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsPropertyDataEvaluator.java index 087b345189..ff89534b23 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsPropertyDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/ObsPropertyDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.obs.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluator.java index 34f095520f..93ae5fc7ad 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PatientToObsDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.Cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsDataEvaluator.java index 95154c224a..b55ba79922 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/evaluator/PersonToObsDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.evaluator; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataService.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataService.java index 66cd382371..ebb7572685 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataService.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataService.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.service; import org.openmrs.module.reporting.data.obs.EvaluatedObsData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataServiceImpl.java index b1ce96379a..b47261e64d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/obs/service/ObsDataServiceImpl.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.obs.service; import org.openmrs.module.reporting.data.obs.EvaluatedObsData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/EvaluatedPatientData.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/EvaluatedPatientData.java index 89d2dd0822..ca417b479c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/EvaluatedPatientData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/EvaluatedPatientData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/PatientData.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/PatientData.java index f3b9c2b61d..4486b16b16 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/PatientData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/PatientData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ConvertedPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ConvertedPatientDataDefinition.java index 48e5ddc131..d73646fa57 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ConvertedPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ConvertedPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/CurrentPatientStateDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/CurrentPatientStateDataDefinition.java index 675a779372..662a76ff0a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/CurrentPatientStateDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/CurrentPatientStateDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DefinitionLibraryPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DefinitionLibraryPatientDataDefinition.java index d448256d0c..80bafacd3b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DefinitionLibraryPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DefinitionLibraryPatientDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.patient.definition; import org.openmrs.module.reporting.data.BaseDefinitionLibraryDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DrugOrdersForPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DrugOrdersForPatientDataDefinition.java index ce9c2e9bda..824b5d4761 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DrugOrdersForPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/DrugOrdersForPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/EncountersForPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/EncountersForPatientDataDefinition.java index 6076532b2f..05a0d4b90b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/EncountersForPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/EncountersForPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/LogicDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/LogicDataDefinition.java index cda6d2f742..2300a3590e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/LogicDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/LogicDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientCalculationDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientCalculationDataDefinition.java index 94dea01511..81b0da7284 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientCalculationDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientCalculationDataDefinition.java @@ -1,18 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - - package org.openmrs.module.reporting.data.patient.definition; import org.openmrs.calculation.CalculationRegistration; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataDefinition.java index fa67f4f59b..773f6299a3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataSetDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataSetDataDefinition.java index 1f5c732054..c7fa947798 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataSetDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientDataSetDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdDataDefinition.java index 5b19cc2d2e..d74144efc4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdentifierDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdentifierDataDefinition.java index a75c94d534..0679b72dd2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdentifierDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientIdentifierDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientObjectDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientObjectDataDefinition.java index 1cce0d054f..f172c9fbbd 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientObjectDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PatientObjectDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PersonToPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PersonToPatientDataDefinition.java index e3ba45d7a9..3aa7ff70a6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PersonToPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PersonToPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PreferredIdentifierDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PreferredIdentifierDataDefinition.java index e5251db96b..fbacd59186 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PreferredIdentifierDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/PreferredIdentifierDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramEnrollmentsForPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramEnrollmentsForPatientDataDefinition.java index 247dce514f..758ecd831b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramEnrollmentsForPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramEnrollmentsForPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramStatesForPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramStatesForPatientDataDefinition.java index 091ff04741..07cd32c8dd 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramStatesForPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ProgramStatesForPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ScriptedCompositionPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ScriptedCompositionPatientDataDefinition.java index b30505c636..94cd95bfc5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ScriptedCompositionPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/ScriptedCompositionPatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/SqlPatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/SqlPatientDataDefinition.java index 02c0181eda..32ca762711 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/SqlPatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/SqlPatientDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.definition; import org.openmrs.module.reporting.data.BaseSqlDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/StaticValuePatientDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/StaticValuePatientDataDefinition.java index 8347431f4b..de32c901b3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/StaticValuePatientDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/definition/StaticValuePatientDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluator.java index 9a0e80010c..bed2645c6d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ConvertedPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluator.java index be9608326d..1dbefffd46 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/CurrentPatientStateDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluator.java index 1a8e7e9ac8..5c9d55c71b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DefinitionLibraryPatientDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.patient.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluator.java index 50587f4472..33aa125688 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/DrugOrdersForPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluator.java index f775d56cd0..243e507c46 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/EncountersForPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluator.java index 660786df2f..767697c48c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/LogicDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluator.java index 794acc8b30..74762867ea 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientCalculationDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataEvaluator.java index 6b8aec7f86..0393d0df17 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataSetDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataSetDataEvaluator.java index d1fcc1e185..95292fe941 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataSetDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientDataSetDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluator.java index a763a8e9d3..c3d1c3ab39 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluator.java index 564cdf8b04..a3f7936335 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientIdentifierDataEvaluator.java @@ -1,112 +1,112 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.data.patient.evaluator; - -import org.openmrs.PatientIdentifier; -import org.openmrs.PatientIdentifierType; -import org.openmrs.annotation.Handler; -import org.openmrs.module.reporting.common.ListMap; -import org.openmrs.module.reporting.data.patient.EvaluatedPatientData; -import org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition; -import org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition; -import org.openmrs.module.reporting.evaluation.EvaluationContext; -import org.openmrs.module.reporting.evaluation.EvaluationException; -import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; -import org.openmrs.module.reporting.evaluation.service.EvaluationService; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -/** - * Evaluates a PatientIdentifierDataDefinition to produce a PatientData - */ -@Handler(supports=PatientIdentifierDataDefinition.class, order=50) -public class PatientIdentifierDataEvaluator implements PatientDataEvaluator { - - @Autowired - EvaluationService evaluationService; - - /** - * @see PatientDataEvaluator#evaluate(PatientDataDefinition, EvaluationContext) - * - * @should return all identifiers of the specified types in order for each patient - * @should return all identifiers in groups according to preferred list order - * @should place all preferred identifiers first within type groups - */ - public EvaluatedPatientData evaluate(PatientDataDefinition definition, EvaluationContext context) throws EvaluationException { - - PatientIdentifierDataDefinition def = (PatientIdentifierDataDefinition) definition; - EvaluatedPatientData c = new EvaluatedPatientData(def, context); - - if ((context.getBaseCohort() != null && context.getBaseCohort().isEmpty()) || def.getTypes() == null || def.getTypes().isEmpty()) { - return c; - } - - HqlQueryBuilder q = new HqlQueryBuilder(); - q.select("pi.patient.patientId", "pi"); - q.from(PatientIdentifier.class, "pi"); - q.wherePatientIn("pi.patient.patientId", context); - q.whereIn("pi.identifierType", def.getTypes()); - q.orderDesc("pi.preferred"); - - List queryResult = evaluationService.evaluateToList(q, context); - - ListMap patIds = new ListMap(); - for (Object[] row : queryResult) { - patIds.putInList((Integer) row[0], (PatientIdentifier) row[1]); - } - - // Order the resulting patient identifiers by the type of identifiers passed in, followed by preferred/non-preferred - PatientIdentifierComparator comparator = new PatientIdentifierComparator(def.getTypes()); - for (Integer pId : patIds.keySet()) { - List l = patIds.get(pId); - Collections.sort(l, comparator); - if (def.getIncludeFirstNonNullOnly() == Boolean.TRUE) { - c.addData(pId, l.get(0)); - } - else { - c.addData(pId, l); - } - } - - return c; - } - - /** - * Helper comparator class for sorting patient identifiers in each List - */ - protected class PatientIdentifierComparator implements Comparator { - - private List idTypes; - - public PatientIdentifierComparator(List idTypes) { - this.idTypes = idTypes; - } - - /** - * @see Comparator#compare(Object, Object) - */ - public int compare(PatientIdentifier pi1, PatientIdentifier pi2) { - int c1 = idTypes.indexOf(pi1.getIdentifierType()); - int c2 = idTypes.indexOf(pi2.getIdentifierType()); - if (c1 == c2) { - c1 = pi1.getPreferred() == Boolean.TRUE ? 0 : 1; - c2 = pi2.getPreferred() == Boolean.TRUE ? 0 : 1; - } - return c1-c2; - } - } -} +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.data.patient.evaluator; + +import org.openmrs.PatientIdentifier; +import org.openmrs.PatientIdentifierType; +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.common.ListMap; +import org.openmrs.module.reporting.data.patient.EvaluatedPatientData; +import org.openmrs.module.reporting.data.patient.definition.PatientDataDefinition; +import org.openmrs.module.reporting.data.patient.definition.PatientIdentifierDataDefinition; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.EvaluationException; +import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder; +import org.openmrs.module.reporting.evaluation.service.EvaluationService; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * Evaluates a PatientIdentifierDataDefinition to produce a PatientData + */ +@Handler(supports=PatientIdentifierDataDefinition.class, order=50) +public class PatientIdentifierDataEvaluator implements PatientDataEvaluator { + + @Autowired + EvaluationService evaluationService; + + /** + * @see PatientDataEvaluator#evaluate(PatientDataDefinition, EvaluationContext) + * + * @should return all identifiers of the specified types in order for each patient + * @should return all identifiers in groups according to preferred list order + * @should place all preferred identifiers first within type groups + */ + public EvaluatedPatientData evaluate(PatientDataDefinition definition, EvaluationContext context) throws EvaluationException { + + PatientIdentifierDataDefinition def = (PatientIdentifierDataDefinition) definition; + EvaluatedPatientData c = new EvaluatedPatientData(def, context); + + if (context.getBaseCohort() != null && context.getBaseCohort().isEmpty()) { + return c; + } + + HqlQueryBuilder q = new HqlQueryBuilder(); + q.select("pi.patient.patientId", "pi"); + q.from(PatientIdentifier.class, "pi"); + q.wherePatientIn("pi.patient.patientId", context); + q.whereIn("pi.identifierType", def.getTypes()); + q.orderDesc("pi.preferred"); + + List queryResult = evaluationService.evaluateToList(q, context); + + ListMap patIds = new ListMap(); + for (Object[] row : queryResult) { + patIds.putInList((Integer) row[0], (PatientIdentifier) row[1]); + } + + // Order the resulting patient identifiers by the type of identifiers passed in, followed by preferred/non-preferred + PatientIdentifierComparator comparator = new PatientIdentifierComparator(def.getTypes()); + for (Integer pId : patIds.keySet()) { + List l = patIds.get(pId); + Collections.sort(l, comparator); + if (def.getIncludeFirstNonNullOnly() == Boolean.TRUE) { + c.addData(pId, l.get(0)); + } + else { + c.addData(pId, l); + } + } + + return c; + } + + /** + * Helper comparator class for sorting patient identifiers in each List + */ + protected class PatientIdentifierComparator implements Comparator { + + private List idTypes; + + public PatientIdentifierComparator(List idTypes) { + this.idTypes = idTypes; + } + + /** + * @see Comparator#compare(Object, Object) + */ + public int compare(PatientIdentifier pi1, PatientIdentifier pi2) { + int c1 = 0; + int c2 = 0; + if (idTypes != null && idTypes.size() > 0) { + c1 = idTypes.indexOf(pi1.getIdentifierType()); + c2 = idTypes.indexOf(pi2.getIdentifierType()); + } + if (c1 == c2) { + c1 = pi1.getPreferred() == Boolean.TRUE ? 0 : 1; + c2 = pi2.getPreferred() == Boolean.TRUE ? 0 : 1; + } + return c1-c2; + } + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluator.java index a5aa6f94b8..b7f7ec67f1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientObjectDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientPropertyDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientPropertyDataEvaluator.java index 7c38fb0c03..7de7f154d2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientPropertyDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PatientPropertyDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluator.java index fb4abe85ee..c5cb33d6ad 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PersonToPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluator.java index 0349b367f0..1b4f012fb8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/PreferredIdentifierDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluator.java index 7b1513cec4..8261b30906 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramEnrollmentsForPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluator.java index f4ed37e519..dce76969fe 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ProgramStatesForPatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataDefinitionEvaluator.java index bf898c45d2..2c22a7b5b6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/ScriptedCompositionPatientDataDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluator.java index b30677afd0..c362f93e8b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/SqlPatientDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.patient.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/StaticValuePatientDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/StaticValuePatientDataEvaluator.java index 70094320a5..f151fd31d3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/StaticValuePatientDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/evaluator/StaticValuePatientDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibrary.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibrary.java index 81c378f454..c562385697 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/library/BuiltInPatientDataLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.patient.library; import org.openmrs.PatientIdentifier; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/persister/SerializedPatientDataPersister.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/persister/SerializedPatientDataPersister.java index 5efb47af50..8fc47e6f3e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/persister/SerializedPatientDataPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/persister/SerializedPatientDataPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataService.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataService.java index 5f9dd6be5a..98ee05b792 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataService.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImpl.java index 56e00751e7..0f2ec4cf47 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/patient/service/PatientDataServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.patient.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/EvaluatedPersonData.java b/api/src/main/java/org/openmrs/module/reporting/data/person/EvaluatedPersonData.java index 4bc35c9e0e..8ccfb2dffb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/EvaluatedPersonData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/EvaluatedPersonData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/PersonData.java b/api/src/main/java/org/openmrs/module/reporting/data/person/PersonData.java index 67eb9f87d3..b8ba69e8f7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/PersonData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/PersonData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/PersonDataUtil.java b/api/src/main/java/org/openmrs/module/reporting/data/person/PersonDataUtil.java index d9bfc5ded8..eec61ce804 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/PersonDataUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/PersonDataUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeAtDateOfOtherDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeAtDateOfOtherDataDefinition.java index 00fb18817d..4d6b5ce8c0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeAtDateOfOtherDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeAtDateOfOtherDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeDataDefinition.java index 244cfc4765..6babd85a54 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/AgeDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/BirthdateDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/BirthdateDataDefinition.java index 23a494334a..1985ec006f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/BirthdateDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/BirthdateDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ConvertedPersonDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ConvertedPersonDataDefinition.java index 98e0c14956..fb4d3a6104 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ConvertedPersonDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ConvertedPersonDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/GenderDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/GenderDataDefinition.java index 4771ee9384..78d2a55eb7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/GenderDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/GenderDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsActiveListPersonDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsActiveListPersonDataDefinition.java index f335d56364..8a091a2db0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsActiveListPersonDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsActiveListPersonDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsForPersonDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsForPersonDataDefinition.java index 4ff1c5e897..ad88baf429 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsForPersonDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/ObsForPersonDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonAttributeDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonAttributeDataDefinition.java index ebfac5a240..1566f38384 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonAttributeDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonAttributeDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonDataDefinition.java index 6d56001d17..f354adb872 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonIdDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonIdDataDefinition.java index 812712d0ed..93fbe50891 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonIdDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PersonIdDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredAddressDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredAddressDataDefinition.java index 3c9dbe010e..cc9fa1b5c6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredAddressDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredAddressDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredNameDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredNameDataDefinition.java index 583b9ec107..53e3e6bdcc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredNameDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/PreferredNameDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/RelationshipsForPersonDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/RelationshipsForPersonDataDefinition.java index 30068b40b1..e949f0fb4f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/RelationshipsForPersonDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/RelationshipsForPersonDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/VitalStatusDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/VitalStatusDataDefinition.java index a240784b6b..7e215c763f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/definition/VitalStatusDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/definition/VitalStatusDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluator.java index 374aa0816f..7a62b4bd5e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeAtDateOfOtherDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluator.java index 4fa50b46f5..42778ed1b6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/AgeDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluator.java index 9770bed0c0..74cb959f2d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/BirthdateDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluator.java index 406738ed38..254d5082ae 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ConvertedPersonDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluator.java index f131612d41..1f7e9db2ee 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/GenderDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluator.java index 650636f730..a1f4af2508 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsActiveListPersonDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluator.java index 088d26c67b..c02bc6e5d8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/ObsForPersonDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluator.java index 23ae3d3b67..39911181bb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonAttributeDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonDataEvaluator.java index 080b36c199..f86bee656c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluator.java index 1fb34eaaa6..184c1e5fb5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonIdDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonPropertyDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonPropertyDataEvaluator.java index 1906423012..ccb6d4ff5b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonPropertyDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PersonPropertyDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluator.java index ccdd784dcf..a03b967aa3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredAddressDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluator.java index d8b235abf2..531628ba25 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/PreferredNameDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluator.java index 146c2e5ed5..7dd33425de 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/RelationshipsForPersonDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluator.java index 4cf2efe560..0870b1e389 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/evaluator/VitalStatusDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/persister/SerializedPersonDataPersister.java b/api/src/main/java/org/openmrs/module/reporting/data/person/persister/SerializedPersonDataPersister.java index 0e8b5edd27..448189f53b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/persister/SerializedPersonDataPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/persister/SerializedPersonDataPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataService.java b/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataService.java index 226abe4139..b258e32fbb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataService.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImpl.java index 75847f572b..12129cbecf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/person/service/PersonDataServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.person.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/EvaluatedVisitData.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/EvaluatedVisitData.java index b92fc76df1..eb28c5bcf5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/EvaluatedVisitData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/EvaluatedVisitData.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit; import org.openmrs.module.reporting.data.visit.definition.VisitDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitData.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitData.java index a4f3828ef3..0ebabe817f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitData.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitData.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit; import org.openmrs.module.reporting.data.BaseData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitDataUtil.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitDataUtil.java index 81b5caa800..a66c55a089 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitDataUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/VisitDataUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/ObsForVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/ObsForVisitDataDefinition.java index a87d5f939d..420a6f2919 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/ObsForVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/ObsForVisitDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/OrderForVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/OrderForVisitDataDefinition.java index b10df2d992..33c9a91b2b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/OrderForVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/OrderForVisitDataDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PatientToVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PatientToVisitDataDefinition.java index 29188feb41..0036cc89de 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PatientToVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PatientToVisitDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.definition; import org.openmrs.module.reporting.data.JoinDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PersonToVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PersonToVisitDataDefinition.java index 7a79e9d1c9..566cf6c1d6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PersonToVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/PersonToVisitDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.definition; import org.openmrs.module.reporting.data.JoinDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/SqlVisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/SqlVisitDataDefinition.java index 220f3f2bc2..3ac94fa003 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/SqlVisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/SqlVisitDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.definition; import org.openmrs.module.reporting.data.BaseDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitDataDefinition.java index 862047e380..9ace528982 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitDataDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.definition; import org.openmrs.module.reporting.data.DataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitIdDataDefinition.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitIdDataDefinition.java index 65bcd930cf..a928ff9fd4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitIdDataDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/definition/VisitIdDataDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.definition; import org.openmrs.module.reporting.data.BaseDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluator.java index c44a03519c..cc1934dd5d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/ObsForVisitDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluator.java index 1c9bb7940c..f239dcc24e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/OrderForVisitDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluator.java index 3d1305abb0..b66b6aa6b7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PatientToVisitDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.openmrs.Cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluator.java index f74d3f4932..fae6c66a9d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/PersonToVisitDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.openmrs.Cohort; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluator.java index 91341e5cd6..9a547a9cd4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/SqlVisitDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import java.util.Map; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitDataEvaluator.java index e1b7ec8a36..975b4a5ba9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitDataEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.evaluator; import org.openmrs.module.reporting.data.visit.EvaluatedVisitData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluator.java index 13ace93aee..9997f76f31 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitIdDataEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.data.visit.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitPropertyDataEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitPropertyDataEvaluator.java index 3dd1648926..18d903e682 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitPropertyDataEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/evaluator/VisitPropertyDataEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.data.visit.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibrary.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibrary.java index 9c99ca7684..b7d2968d6b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/library/BuiltInVisitDataLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.library; import org.openmrs.module.reporting.data.visit.definition.VisitDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataService.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataService.java index 963ae9d9aa..ab60f272b2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataService.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataService.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.service; import org.openmrs.module.reporting.data.visit.EvaluatedVisitData; diff --git a/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataServiceImpl.java index ad75159a28..ad1da16198 100644 --- a/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/data/visit/service/VisitDataServiceImpl.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.data.visit.service; import org.openmrs.module.reporting.data.visit.EvaluatedVisitData; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSet.java index 03d500fbb4..b7b7f3606c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetColumn.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetColumn.java index c35b5d9e25..b36a208872 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetColumn.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetColumn.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetMetaData.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetMetaData.java index f752b3a4a2..dac179f2e3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetMetaData.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetMetaData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRow.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRow.java index 0a33364e12..c8dbbfe834 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRow.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRow.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowComparator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowComparator.java index 114620d27c..8a6cce0fd0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowComparator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowComparator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowList.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowList.java index dd966b9b86..17253697f5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowList.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetRowList.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetUtil.java b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetUtil.java index 6d3ba2df0c..54d6288ca0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/DataSetUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/IterableSqlDataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/IterableSqlDataSet.java new file mode 100644 index 0000000000..dbf0d99f17 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/IterableSqlDataSet.java @@ -0,0 +1,76 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + *

+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.dataset; + +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.IterableSqlDataSetDefinition; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.common.ResultSetIterator; + +import java.util.Iterator; + +/** + * This is a {@link DataSet} that allows you to request the rows for a subset of the + * input cohort, and it will generate those rows on demand (by delegating to a + * {@link IterableDataSetEvaluator}). + */ +public class IterableSqlDataSet implements DataSet { + + ResultSetIterator dataSetRowIterator; + SimpleDataSetMetaData metadata; + EvaluationContext context; + IterableSqlDataSetDefinition definition; + + /** + * @param evalContext + * @param definition + */ + public IterableSqlDataSet(EvaluationContext evalContext, IterableSqlDataSetDefinition definition, ResultSetIterator iterator) { + this.context = evalContext; + this.definition = definition; + this.dataSetRowIterator = iterator; + mapMetaData(); + } + + /** + * @see DataSet#iterator() + */ + public Iterator iterator() { + return dataSetRowIterator; + } + + /** + * @see DataSet#getMetaData() + */ + public DataSetMetaData getMetaData() { + return metadata; + } + + /** + * @see DataSet#getContext() + */ + public EvaluationContext getContext() { + return context; + } + + /** + * @see DataSet#getDefinition() + */ + public DataSetDefinition getDefinition() { + return definition; + } + + private void mapMetaData(){ + metadata = new SimpleDataSetMetaData(); + for(DataSetColumn column: dataSetRowIterator.getColumns()){ + metadata.addColumn(new DataSetColumn(column.getName(),column.getLabel(),column.getDataType())); + } + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/LazyPageableDataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/LazyPageableDataSet.java index 7035cde03b..2d4ec49ae5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/LazyPageableDataSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/LazyPageableDataSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/MapDataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/MapDataSet.java index 7d36320815..5ff0c21fa5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/MapDataSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/MapDataSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/PageableDataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/PageableDataSet.java index 7b92221406..50995542c4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/PageableDataSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/PageableDataSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSet.java b/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSet.java index d94639b29c..02afaea239 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSet.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset; import org.openmrs.module.reporting.common.SortCriteria; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSetMetaData.java b/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSetMetaData.java index c370beafe9..2d0d5c3501 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSetMetaData.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/SimpleDataSetMetaData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/BaseColumnDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/BaseColumnDefinition.java index 4471b2735e..0d3cd10da9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/BaseColumnDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/BaseColumnDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.column.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/ColumnDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/ColumnDefinition.java index ae78a4662b..f6bc7c5b9e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/ColumnDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/ColumnDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.column.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/RowPerObjectColumnDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/RowPerObjectColumnDefinition.java index 731ea7c618..6e7b4c30c8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/RowPerObjectColumnDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/column/definition/RowPerObjectColumnDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.column.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/BaseDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/BaseDataSetDefinition.java index 1b57b580d2..89ab5e5e26 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/BaseDataSetDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/BaseDataSetDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortCrossTabDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortCrossTabDataSetDefinition.java index d316dd5cf4..cf7ee0a32a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortCrossTabDataSetDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortCrossTabDataSetDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortIndicatorAndDimensionDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortIndicatorAndDimensionDataSetDefinition.java index 1a0b323066..f95dde8cf2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortIndicatorAndDimensionDataSetDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortIndicatorAndDimensionDataSetDefinition.java @@ -1,11 +1,14 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - import org.openmrs.module.reporting.common.Localized; import org.openmrs.module.reporting.dataset.DataSetColumn; import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty; @@ -14,6 +17,13 @@ import org.openmrs.module.reporting.indicator.dimension.CohortDefinitionDimension; import org.openmrs.module.reporting.indicator.util.IndicatorUtil; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + /** *

  * This represents a data set which contains indicators and optional dimension combinations
@@ -163,7 +173,7 @@ public void addSpecification(String indicatorNumber, String label, Mapped
  * This represents a data set where each column is an Indicator plus (optionally) dimension options
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortsWithVaryingParametersDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortsWithVaryingParametersDataSetDefinition.java
index 76a09b9806..e7638357ff 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortsWithVaryingParametersDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/CohortsWithVaryingParametersDataSetDefinition.java
@@ -1,17 +1,12 @@
-/*
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
-
 package org.openmrs.module.reporting.dataset.definition;
 
 import org.openmrs.module.reporting.cohort.EvaluatedCohort;
@@ -66,6 +61,10 @@ public void setVaryingParameters(List> varyingParameters) {
         this.varyingParameters = varyingParameters;
     }
 
+    public void addColumn(String name, String description, Mapped mappedCohortDefinition) {
+        getColumns().add(new Column(name, description, mappedCohortDefinition));
+    }
+
     /**
      * Will automatically create "straight-through" mappings for any parameters in cd, and takes name and label from
      * cd.name and cd.description.
@@ -76,7 +75,12 @@ public void addColumn(CohortDefinition cd) {
         for (Parameter parameter : cd.getParameters()) {
             mappings.put(parameter.getName(), "${" + parameter.getName() + "}");
         }
-        getColumns().add(new Column(cd.getName(), cd.getDescription(), new Mapped(cd, mappings)));
+        addColumn(new Mapped(cd, mappings));
+    }
+
+    public void addColumn(Mapped mappedCohortDefinition) {
+        CohortDefinition cd = mappedCohortDefinition.getParameterizable();
+        addColumn(cd.getName(), cd.getDescription(), mappedCohortDefinition);
     }
 
     public void addVaryingParameters(Map parameterOption) {
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/DataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/DataSetDefinition.java
index 64544420b5..a5900e2f5a 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/DataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/DataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterAndObsDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterAndObsDataSetDefinition.java
index 207c641de4..5eb1209aaa 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterAndObsDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterAndObsDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterDataSetDefinition.java
index c88d7a247b..1a1a28a336 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EncounterDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EvaluatableDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EvaluatableDataSetDefinition.java
index f2d6a4b3d9..75013ffa5b 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EvaluatableDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/EvaluatableDataSetDefinition.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition;
 
 import org.openmrs.module.reporting.dataset.DataSet;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/IterableSqlDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/IterableSqlDataSetDefinition.java
new file mode 100644
index 0000000000..af98495705
--- /dev/null
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/IterableSqlDataSetDefinition.java
@@ -0,0 +1,22 @@
+/**
+ * The contents of this file are subject to the OpenMRS Public License
+ * Version 1.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://license.openmrs.org
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ */
+package org.openmrs.module.reporting.dataset.definition;
+
+/**
+ * Evaluates a sql script found at the configured file path or resource path or with the sql contents specified
+ * By default, this will utilize the database connection properties in the openmrs runtime properties
+ * This can use an alternative database connection by specifying the file.  Property names follow those in openmrs runtime properties
+ */
+public class IterableSqlDataSetDefinition extends SqlFileDataSetDefinition {
+}
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/LogicDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/LogicDataSetDefinition.java
index 896d8aa1f0..8756db7926 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/LogicDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/LogicDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiParameterDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiParameterDataSetDefinition.java
index e6ca065cd1..f19c9f5796 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiParameterDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiParameterDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiPeriodIndicatorDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiPeriodIndicatorDataSetDefinition.java
index 3b2ce3d921..665e781926 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiPeriodIndicatorDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/MultiPeriodIndicatorDataSetDefinition.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition;
 
 import java.util.ArrayList;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/ObsDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/ObsDataSetDefinition.java
index 1d7c5d3253..1160bd7b8b 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/ObsDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/ObsDataSetDefinition.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition;
 
 import org.openmrs.module.reporting.common.Localized;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PageableDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PageableDataSetDefinition.java
index 5730ae6563..b4bc78dce9 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PageableDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PageableDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PatientDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PatientDataSetDefinition.java
index af714db4bc..4e24c3329a 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PatientDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/PatientDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RepeatPerTimePeriodDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RepeatPerTimePeriodDataSetDefinition.java
index 84c5891c3a..b39240cc8e 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RepeatPerTimePeriodDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RepeatPerTimePeriodDataSetDefinition.java
@@ -1,17 +1,12 @@
-/*
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
-
 package org.openmrs.module.reporting.dataset.definition;
 
 import org.openmrs.module.reporting.common.TimePeriod;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RowPerObjectDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RowPerObjectDataSetDefinition.java
index 552bfe97a4..6199813c56 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RowPerObjectDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/RowPerObjectDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimpleIndicatorDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimpleIndicatorDataSetDefinition.java
index 848046cdff..3f3dc6eec2 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimpleIndicatorDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimpleIndicatorDataSetDefinition.java
@@ -1,17 +1,12 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
-
 package org.openmrs.module.reporting.dataset.definition;
 
 import java.util.ArrayList;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimplePatientDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimplePatientDataSetDefinition.java
index 7d8381c3bc..c51e0098b2 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimplePatientDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SimplePatientDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlDataSetDefinition.java
index bf97a2b429..721c291289 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlDataSetDefinition.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlFileDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlFileDataSetDefinition.java
new file mode 100644
index 0000000000..b37d6cf3a9
--- /dev/null
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/SqlFileDataSetDefinition.java
@@ -0,0 +1,88 @@
+/**
+ * The contents of this file are subject to the OpenMRS Public License
+ * Version 1.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://license.openmrs.org
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ */
+package org.openmrs.module.reporting.dataset.definition;
+
+import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty;
+
+/**
+ * Evaluates a sql script found at the configured file path or resource path or with the sql contents specified
+ * By default, this will utilize the database connection properties in the openmrs runtime properties
+ * This can use an alternative database connection by specifying the file.  Property names follow those in openmrs runtime properties
+ */
+public class SqlFileDataSetDefinition extends BaseDataSetDefinition {
+
+    public enum MetadataParameterConversion {
+        ID, UUID, NAME
+    }
+
+	@ConfigurationProperty
+	private String sqlFile;
+
+	@ConfigurationProperty
+    private String sqlResource;
+
+	@ConfigurationProperty
+    private String sql;
+
+	@ConfigurationProperty
+    private String connectionPropertyFile;
+
+	@ConfigurationProperty
+	private MetadataParameterConversion metadataParameterConversion = MetadataParameterConversion.ID;
+
+	/**
+	 * Constructor
+	 */
+	public SqlFileDataSetDefinition() {}
+
+    public String getSqlFile() {
+        return sqlFile;
+    }
+
+    public void setSqlFile(String sqlFile) {
+        this.sqlFile = sqlFile;
+    }
+
+    public String getSqlResource() {
+        return sqlResource;
+    }
+
+    public void setSqlResource(String sqlResource) {
+        this.sqlResource = sqlResource;
+    }
+
+    public String getSql() {
+        return sql;
+    }
+
+    public void setSql(String sql) {
+        this.sql = sql;
+    }
+
+    public String getConnectionPropertyFile() {
+        return connectionPropertyFile;
+    }
+
+    public void setConnectionPropertyFile(String connectionPropertyFile) {
+        this.connectionPropertyFile = connectionPropertyFile;
+    }
+
+    public MetadataParameterConversion getMetadataParameterConversion() {
+        return metadataParameterConversion;
+    }
+
+    public void setMetadataParameterConversion(MetadataParameterConversion metadataParameterConversion) {
+        this.metadataParameterConversion = metadataParameterConversion;
+    }
+}
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/VisitDataSetDefinition.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/VisitDataSetDefinition.java
index 9a3bfe388a..d7d79bf11e 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/VisitDataSetDefinition.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/VisitDataSetDefinition.java
@@ -1,17 +1,12 @@
-/*
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
-
 package org.openmrs.module.reporting.dataset.definition;
 
 import org.openmrs.module.reporting.common.TimeQualifier;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortDataSetEvaluator.java
index fc68de5189..e89127dc8c 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortDataSetEvaluator.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorAndDimensionDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorAndDimensionDataSetEvaluator.java
index 0e7f8560ac..7276992e6c 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorAndDimensionDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorAndDimensionDataSetEvaluator.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
 import java.util.List;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluator.java
index 7708248a4c..f1d92337b5 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortIndicatorDataSetEvaluator.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
 import java.util.HashMap;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluator.java
index b8148e0c22..b010605731 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/CohortsWithVaryingParametersDataSetEvaluator.java
@@ -1,17 +1,12 @@
-/*
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
-
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
 import com.github.jknack.handlebars.Template;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataSetEvaluator.java
index 46b685ad1a..64e0011efc 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/DataSetEvaluator.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
@@ -34,7 +30,7 @@ public interface DataSetEvaluator extends DefinitionEvaluator
 	 * Evaluate a DataSet for the given EvaluationContext
 	 * 
 	 * @param dataSetDefinition
-	 * @param inputCohortencounter_datetime
+	 * @param evalContext
 	 * @return the evaluated DataSet
 	 */
 	public DataSet evaluate(DataSetDefinition dataSetDefinition, EvaluationContext evalContext) throws EvaluationException;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluator.java
index a6339dcae3..14c9330326 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterAndObsDataSetEvaluator.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluator.java
index 730b0dedc4..66b31429ef 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EncounterDataSetEvaluator.java
@@ -1,15 +1,11 @@
 /**
- * The contents of this file are subject to the OpenMRS Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://license.openmrs.org
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific language governing rights and limitations
- * under the License.
- *
- * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
  */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluator.java
index 25e42e53f3..2494a42285 100644
--- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluator.java
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/EvaluatableDataSetEvaluator.java
@@ -1,3 +1,12 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ *
+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
+ * graphic logo is a trademark of OpenMRS Inc.
+ */
 package org.openmrs.module.reporting.dataset.definition.evaluator;
 
 import org.openmrs.annotation.Handler;
diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/IterableSqlDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/IterableSqlDataSetEvaluator.java
new file mode 100644
index 0000000000..05ea945008
--- /dev/null
+++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/IterableSqlDataSetEvaluator.java
@@ -0,0 +1,99 @@
+/**
+ * This Source Code Form is subject to the terms of the Mozilla Public License,
+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
+ * 

+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.dataset.definition.evaluator; + +import org.apache.commons.lang.StringUtils; +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.common.ObjectUtil; +import org.openmrs.module.reporting.common.ResultSetIterator; +import org.openmrs.module.reporting.common.SqlRunner; +import org.openmrs.module.reporting.dataset.DataSet; +import org.openmrs.module.reporting.dataset.IterableSqlDataSet; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.IterableSqlDataSetDefinition; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.EvaluationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.sql.Connection; +import java.util.Map; +import java.util.Properties; + +/** + * The logic that evaluates a {@link IterableSqlDataSetDefinition} and produces an {@link DataSet} + * + * @see IterableSqlDataSetDefinition + */ +@Handler(supports = {IterableSqlDataSetDefinition.class}, order = 50) +public class IterableSqlDataSetEvaluator extends SqlFileDataSetEvaluator { + + private static final Logger log = LoggerFactory.getLogger(IterableSqlDataSetEvaluator.class); + + /** + * @should evaluate a IterableSqlDataSetDefinition + * @should evaluate a IterableSqlDataSetDefinition with parameters + * @should evaluate a IterableSqlDataSetDefinition with in statement + * @should protect SQL Query Against database modifications + * @see DataSetEvaluator#evaluate(DataSetDefinition, EvaluationContext) + */ + @Override + public DataSet evaluate(DataSetDefinition dataSetDefinition, EvaluationContext context) throws EvaluationException { + + context = ObjectUtil.nvl(context, new EvaluationContext()); + IterableSqlDataSetDefinition definition = (IterableSqlDataSetDefinition) dataSetDefinition; + ResultSetIterator iterator; + Connection connection; + try { + connection = getConnection(definition, context); + SqlRunner runner = new SqlRunner(connection); + Map parameterValues = constructParameterValues(definition, context); + + if (StringUtils.isNotBlank(definition.getSqlFile())) { + File sqlFile = new File(definition.getSqlFile()); + if (!sqlFile.exists()) { + throw new EvaluationException("Unable to find Sql File to execute: " + definition.getSqlFile()); + } + log.info("Executing SQL File at " + sqlFile + " with parameters " + parameterValues); + iterator = runner.executeSqlFileToIterator(sqlFile, parameterValues); + } else if (StringUtils.isNotBlank(definition.getSqlResource())) { + log.info("Executing SQL Resource at " + definition.getSqlResource() + " with parameters " + parameterValues); + iterator = runner.executeSqlResourceToIterator(definition.getSqlResource(), parameterValues); + } else if (StringUtils.isNotBlank(definition.getSql())) { + log.info("Executing SQL with parameters " + parameterValues); + iterator = runner.executeSqlToIterator(definition.getSql(), parameterValues); + } else { + throw new EvaluationException("A SqlFileDataSetDefinition must define either a SQL File or SQL Resource"); + } + } + catch (EvaluationException ee) { + throw ee; + } + catch (Exception e) { + throw new EvaluationException("An error occurred while evaluating a SqlFileDataSetDefinition", e); + } + + return new IterableSqlDataSet(context, definition, iterator); + } + + /** + * @return a new connection given a set of connection properties + */ + @Override + protected Properties getConnectionProperties(String connectionPropertyFile) throws EvaluationException { + Properties p = super.getConnectionProperties(connectionPropertyFile); + String url = p.getProperty("connection.url"); + if (url != null && !url.contains("useCursorFetch")) { + p.setProperty("connection.url", url + "&useCursorFetch=true"); + } + return p; + } +} \ No newline at end of file diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LazyPageableDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LazyPageableDataSetEvaluator.java index 3c35baf94e..1bba4526dc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LazyPageableDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LazyPageableDataSetEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluator.java index 52c0d7a959..bc941174b1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/LogicDataSetEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluator.java index 71eea93f8a..b401f8cfa1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiParameterDataSetEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluator.java index b22ac0c030..5481e32b82 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/MultiPeriodIndicatorDataSetEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import java.util.Arrays; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluator.java index 66ae37cab4..1f2404cf84 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/ObsDataSetEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.dataset.definition.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluator.java index 0767e17c97..5a561e370d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/PatientDataSetEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluator.java index 4c4cbccb73..e51b99ca3b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/RepeatPerTimePeriodDataSetEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.joda.time.DateTime; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimpleIndicatorDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimpleIndicatorDataSetEvaluator.java index 4ed8ed03ed..745edc7787 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimpleIndicatorDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimpleIndicatorDataSetEvaluator.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluator.java index e1f55f8851..7a5f8d1884 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SimplePatientDataSetEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluator.java index fe002824a6..ab7709a107 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlDataSetEvaluator.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluator.java new file mode 100644 index 0000000000..6c9d0de447 --- /dev/null +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/SqlFileDataSetEvaluator.java @@ -0,0 +1,183 @@ +/** + * The contents of this file are subject to the OpenMRS Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License at + * http://license.openmrs.org + *

+ * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + *

+ * Copyright (C) OpenMRS, LLC. All Rights Reserved. + */ +package org.openmrs.module.reporting.dataset.definition.evaluator; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.OpenmrsMetadata; +import org.openmrs.annotation.Handler; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.common.ObjectUtil; +import org.openmrs.module.reporting.common.SqlResult; +import org.openmrs.module.reporting.common.SqlRunner; +import org.openmrs.module.reporting.dataset.DataSet; +import org.openmrs.module.reporting.dataset.DataSetColumn; +import org.openmrs.module.reporting.dataset.DataSetRow; +import org.openmrs.module.reporting.dataset.SimpleDataSet; +import org.openmrs.module.reporting.dataset.SimpleDataSetMetaData; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.SqlFileDataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.SqlFileDataSetDefinition.MetadataParameterConversion; +import org.openmrs.module.reporting.evaluation.EvaluationContext; +import org.openmrs.module.reporting.evaluation.EvaluationException; +import org.openmrs.util.OpenmrsUtil; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.util.Map; +import java.util.Properties; + +/** + * Evaluates a SqlFileDataSetDefinition and produces results + */ +@Handler(supports = {SqlFileDataSetDefinition.class}) +public class SqlFileDataSetEvaluator implements DataSetEvaluator { + protected Log log = LogFactory.getLog(this.getClass()); + + /** + * @see DataSetEvaluator#evaluate(DataSetDefinition, EvaluationContext) + */ + public DataSet evaluate(DataSetDefinition dataSetDefinition, EvaluationContext context) throws EvaluationException { + + context = ObjectUtil.nvl(context, new EvaluationContext()); + SimpleDataSet data = new SimpleDataSet(dataSetDefinition, context); + + SqlFileDataSetDefinition dsd = (SqlFileDataSetDefinition) dataSetDefinition; + + Connection connection = null; + try { + connection = getConnection(dsd, context); + SqlRunner runner = new SqlRunner(connection); + SqlResult resultData = null; + Map parameterValues = constructParameterValues(dsd, context); + + if (StringUtils.isNotBlank(dsd.getSqlFile())) { + File sqlFile = new File(dsd.getSqlFile()); + if (!sqlFile.exists()) { + throw new EvaluationException("Unable to find Sql File to execute: " + dsd.getSqlFile()); + } + log.info("Executing SQL File at " + sqlFile + " with parameters " + parameterValues); + resultData = runner.executeSqlFile(sqlFile, parameterValues); + } else if (StringUtils.isNotBlank(dsd.getSqlResource())) { + log.info("Executing SQL Resource at " + dsd.getSqlResource() + " with parameters " + parameterValues); + resultData = runner.executeSqlResource(dsd.getSqlResource(), parameterValues); + } else if (StringUtils.isNotBlank(dsd.getSql())) { + log.info("Executing SQL with parameters " + parameterValues); + resultData = runner.executeSql(dsd.getSql(), parameterValues); + } else { + throw new EvaluationException("A SqlFileDataSetDefinition must define either a SQL File or SQL Resource"); + } + + if (!resultData.getErrors().isEmpty()) { + throw new EvaluationException("Errors occurred during mysql execution: " + OpenmrsUtil.join(resultData.getErrors(), "; ")); + } + + SimpleDataSetMetaData metaData = new SimpleDataSetMetaData(); + for (String column : resultData.getColumns()) { + metaData.addColumn(new DataSetColumn(column, column, Object.class)); + } + data.setMetaData(metaData); + + for (Map rowData : resultData.getData()) { + DataSetRow row = new DataSetRow(); + for (DataSetColumn column : metaData.getColumns()) { + row.addColumnValue(column, rowData.get(column.getName())); + } + data.addRow(row); + } + } + catch (EvaluationException ee) { + throw ee; + } + catch (Exception e) { + throw new EvaluationException("An error occurred while evaluating a SqlFileDataSetDefinition", e); + } + finally { + try { + if (connection != null) { + connection.close(); + } + } catch (Exception e) { + log.warn("Error closing the database connection for SqlFileDataSetEvaluator", e); + } + } + + return data; + } + + /** + * @return the connection properties to use + */ + protected Properties getConnectionProperties(String connectionPropertyFile) throws EvaluationException { + Properties properties = Context.getRuntimeProperties(); + if (StringUtils.isNotBlank(connectionPropertyFile)) { + properties = new Properties(); + InputStream is = null; + try { + File file = new File(OpenmrsUtil.getApplicationDataDirectory(), connectionPropertyFile); + is = new FileInputStream(file); + properties.load(is); + } catch (Exception e) { + throw new EvaluationException("Unable to load connection properties from file <" + connectionPropertyFile + ">", e); + } finally { + IOUtils.closeQuietly(is); + } + } + return properties; + } + + /** + * @return a new connection given a set of connection properties + */ + protected Connection getConnection(SqlFileDataSetDefinition dsd, EvaluationContext context) throws EvaluationException { + Properties connectionProperties = getConnectionProperties(dsd.getConnectionPropertyFile()); + try { + String driver = connectionProperties.getProperty("connection.driver_class", "com.mysql.jdbc.Driver"); + String url = connectionProperties.getProperty("connection.url"); + String user = connectionProperties.getProperty("connection.username"); + String password = connectionProperties.getProperty("connection.password"); + Context.loadClass(driver); + return DriverManager.getConnection(url, user, password); + } + catch (Exception e) { + throw new EvaluationException("Unable to create a new connection to the database", e); + } + } + + /** + * @return parameter values to use within SQL statement, converting object references to metadata to scalar properties, defaulting to keys + */ + protected Map constructParameterValues(SqlFileDataSetDefinition dsd, EvaluationContext context) { + Map ret = context.getContextValues(); + ret.putAll(context.getParameterValues()); + for (String key : ret.keySet()) { + Object o = ret.get(key); + if (o instanceof OpenmrsMetadata) { + if (dsd.getMetadataParameterConversion() == MetadataParameterConversion.ID) { + ret.put(key, ((OpenmrsMetadata) o).getId()); + } else if (dsd.getMetadataParameterConversion() == MetadataParameterConversion.UUID) { + ret.put(key, ((OpenmrsMetadata) o).getUuid()); + } else if (dsd.getMetadataParameterConversion() == MetadataParameterConversion.NAME) { + ret.put(key, ((OpenmrsMetadata) o).getName()); + } + } + } + return ret; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluator.java index 884d1e856f..9f9d7d985e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/evaluator/VisitDataSetEvaluator.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.dataset.definition.evaluator; import org.apache.commons.lang.time.StopWatch; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/DataSetDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/DataSetDefinitionPersister.java index b3d3c0afa3..48e44e8b7d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/DataSetDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/DataSetDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/SerializedDataSetDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/SerializedDataSetDefinitionPersister.java index 1a8ce013ea..f6d907cfbb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/SerializedDataSetDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/persister/SerializedDataSetDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionService.java index 919a473631..7bdc769e0c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionServiceImpl.java index b97028f823..617912d934 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/definition/service/DataSetDefinitionServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/BaseDataSetQueryService.java b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/BaseDataSetQueryService.java index b5ed7941cf..3d100ee660 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/BaseDataSetQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/BaseDataSetQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.query.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/DataSetQueryService.java b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/DataSetQueryService.java index bb46eb04a7..97d8166e2c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/DataSetQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/DataSetQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.query.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/DataSetQueryDAO.java b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/DataSetQueryDAO.java index 18f4c7c2d2..e3e6fe6a09 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/DataSetQueryDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/DataSetQueryDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.query.service.db; diff --git a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/HibernateDataSetQueryDAO.java b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/HibernateDataSetQueryDAO.java index acebe8a20d..f00d37a712 100644 --- a/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/HibernateDataSetQueryDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/dataset/query/service/db/HibernateDataSetQueryDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.dataset.query.service.db; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionContext.java b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionContext.java index b043a88b4f..13f6349bcf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionSummary.java b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionSummary.java index 5d7869f7ce..d5fedc897a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionSummary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionSummary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition; import org.openmrs.OpenmrsMetadata; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionUtil.java b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionUtil.java index cabf0e809a..3feb6386f6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/DefinitionUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationProperty.java b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationProperty.java index b0e6f25dff..c3d3c02e4d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationProperty.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationProperty.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.configuration; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyAndParameterCachingStrategy.java b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyAndParameterCachingStrategy.java index fc5675197b..e6d50c328d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyAndParameterCachingStrategy.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyAndParameterCachingStrategy.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.configuration; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyCachingStrategy.java b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyCachingStrategy.java index 65be8c0b84..4fcc5a1037 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyCachingStrategy.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/ConfigurationPropertyCachingStrategy.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.configuration; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/Property.java b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/Property.java index 8f4d1f8b6c..1a29e95bbe 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/configuration/Property.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/configuration/Property.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.configuration; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/converter/ConverterUtil.java b/api/src/main/java/org/openmrs/module/reporting/definition/converter/ConverterUtil.java index 18f1dc55d6..ab616d2e0d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/converter/ConverterUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/converter/ConverterUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/converter/DefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/definition/converter/DefinitionConverter.java index 4a46a11260..44ab91f1d8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/converter/DefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/converter/DefinitionConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverter.java index d58584567c..8e2248e880 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/converter/SqlCohortDefinitionConverter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.converter; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/evaluator/DefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/definition/evaluator/DefinitionEvaluator.java index 98451a91fc..0b28d4ca2d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/evaluator/DefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/evaluator/DefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibraries.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibraries.java index 5e8223f958..320d9c3b4a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibraries.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/AllDefinitionLibraries.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.definition.library; import org.openmrs.module.reporting.cohort.definition.DefinitionLibraryCohortDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibrary.java index 371826d361..b76231eb8a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/BaseDefinitionLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.definition.library; import org.apache.commons.lang.StringUtils; @@ -44,7 +39,11 @@ public abstract class BaseDefinitionLibrary implements Def public abstract String getKeyPrefix(); public T getDefinition(String key) { - String lookFor = key.startsWith(getKeyPrefix()) ? key.substring(getKeyPrefix().length()) : key; + String lookFor = key; + String keyPrefix = getKeyPrefix(); + if (keyPrefix != null) { + lookFor = key.startsWith(keyPrefix) ? key.substring(keyPrefix.length()) : key; + } return findAndInvokeMethod(lookFor); } diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/DefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/DefinitionLibrary.java index 6aebe07765..4ca4a7ae01 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/DefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/DefinitionLibrary.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.definition.library; import org.openmrs.module.reporting.evaluation.Definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/DocumentedDefinition.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/DocumentedDefinition.java index 585c906ffa..0afdfe72fc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/DocumentedDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/DocumentedDefinition.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.definition.library; import java.lang.annotation.ElementType; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/LibraryDefinitionSummary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/LibraryDefinitionSummary.java index 6fd5c9d2ac..416b6ef7d0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/LibraryDefinitionSummary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/LibraryDefinitionSummary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library; import org.openmrs.module.reporting.evaluation.parameter.Parameter; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredDefinitionLibrary.java index 4748041d8b..81c220832c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/BaseImplementerConfiguredDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import java.io.File; @@ -96,7 +105,7 @@ private void ensureDefinitions() { } } - private void loadDefinitions() { + public void loadDefinitions() { Map newDefinitions = new HashMap(); List newSummaries = new ArrayList(); @@ -219,4 +228,4 @@ public void setAutowireCapableBeanFactory(AutowireCapableBeanFactory autowireCap this.autowireCapableBeanFactory = autowireCapableBeanFactory; } -} \ No newline at end of file +} diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibrary.java index 062b0b2f7e..bfa8c23d72 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredCohortDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import java.io.File; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibrary.java index 655557df77..3aa53b6467 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredDataSetDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import org.openmrs.module.reporting.cohort.definition.CohortDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibrary.java index 6061e0f616..a4c663a4df 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredEncounterDataDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import org.openmrs.module.reporting.data.encounter.definition.EncounterDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibrary.java index 30cd0ca122..ce57cfb609 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredPatientDataDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import java.io.File; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibrary.java b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibrary.java index 01b4455b6e..da7370d819 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibrary.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/library/implementerconfigured/ImplementerConfiguredVisitDataDefinitionLibrary.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.definition.library.implementerconfigured; import org.openmrs.module.reporting.data.encounter.definition.EncounterDataDefinition; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/persister/DefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/definition/persister/DefinitionPersister.java index 913d940b23..9af46633d8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/persister/DefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/persister/DefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/persister/SerializedDefinitionPersister.java b/api/src/main/java/org/openmrs/module/reporting/definition/persister/SerializedDefinitionPersister.java index 48eae94176..2bcebaddd4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/persister/SerializedDefinitionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/persister/SerializedDefinitionPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/service/BaseDefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/definition/service/BaseDefinitionService.java index 5a44512905..e316fcbdd2 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/service/BaseDefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/service/BaseDefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/service/DefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/definition/service/DefinitionService.java index a7c84598c8..db0a3b1773 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/service/DefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/service/DefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionService.java index 529f4fe2b0..00f10ba097 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionServiceImpl.java index 0cc7400e71..1fbe74b595 100644 --- a/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/definition/service/SerializedDefinitionServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.definition.service; @@ -44,7 +40,7 @@ public class SerializedDefinitionServiceImpl extends BaseOpenmrsService implemen //**************** // Constructor //**************** - private SerializedDefinitionServiceImpl() { } + public SerializedDefinitionServiceImpl() { } //**************** // Properties diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/BaseDefinition.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/BaseDefinition.java index 69d98d8014..47cf1e9c13 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/BaseDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/BaseDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/Definition.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/Definition.java index 117c769468..4c593b1b96 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/Definition.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/Definition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/Evaluated.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/Evaluated.java index 7ae93418a7..d7b49b3a02 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/Evaluated.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/Evaluated.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationConfiguration.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationConfiguration.java index 0e05f21ced..dda7e4312f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationConfiguration.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationConfiguration.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationContext.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationContext.java index ca88436246..59dcf0bbb6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationException.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationException.java index e40569eaa2..37cc323e27 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationException.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationException.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.evaluation; import org.openmrs.api.APIException; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationProfiler.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationProfiler.java index ea3033bafa..5f21205fc4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationProfiler.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationProfiler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.evaluation; import org.apache.commons.io.IOUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationUtil.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationUtil.java index 9705b1de91..8013dace76 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/EvaluationUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/MissingDependencyException.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/MissingDependencyException.java index a82a78433d..02455c3e9b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/MissingDependencyException.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/MissingDependencyException.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.evaluation; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/Caching.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/Caching.java index 6addfd08bf..df6c781349 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/Caching.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/Caching.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.caching; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/CachingStrategy.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/CachingStrategy.java index a791d06fdc..34f892c65b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/CachingStrategy.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/CachingStrategy.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.caching; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/NoCachingStrategy.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/NoCachingStrategy.java index c31d426081..74b1a5b3b4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/NoCachingStrategy.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/caching/NoCachingStrategy.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.caching; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/EncounterEvaluationContext.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/EncounterEvaluationContext.java index 004ccb98cf..e7712df83f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/EncounterEvaluationContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/EncounterEvaluationContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.context; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/ObsEvaluationContext.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/ObsEvaluationContext.java index a4f4365f77..778cf89342 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/ObsEvaluationContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/ObsEvaluationContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.context; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/PersonEvaluationContext.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/PersonEvaluationContext.java index 1bbbc42999..3ee602decc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/PersonEvaluationContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/PersonEvaluationContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.context; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/VisitEvaluationContext.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/VisitEvaluationContext.java index 2ad315aba3..7aadcb704a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/context/VisitEvaluationContext.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/context/VisitEvaluationContext.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.context; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Mapped.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Mapped.java index 174bb7e34c..2e1e18703d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Mapped.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Mapped.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.parameter; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameter.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameter.java index 93ca3d02da..479686132f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameter.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameter.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.parameter; @@ -156,6 +152,21 @@ public Parameter(String name, String label, Class type) { public Parameter(String name, String label, Class type, Properties widgetConfiguration) { this(name, label, type, null, null, widgetConfiguration); } + + /** + * Initialize this Parameter with the values from an existing Parameter. This is equivalent to cloning. + * + * @param p the Parameter to clone from + */ + public Parameter(Parameter p) { + setName(p.getName()); + setLabel(p.getLabel()); + setType(p.getType()); + setCollectionType(p.getCollectionType()); + setRequired(p.isRequired()); + setDefaultValue(p.getDefaultValue()); + setWidgetConfiguration(p.getWidgetConfiguration()); + } //*********************** // INSTANCE METHODS diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterException.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterException.java index d06ca0f888..434bac4869 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterException.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.parameter; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameterizable.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameterizable.java index 56f8858399..243dd4df70 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameterizable.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/Parameterizable.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.parameter; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterizableUtil.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterizableUtil.java index 19de75801a..7a09f3a9b4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterizableUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/parameter/ParameterizableUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.evaluation.parameter; import org.apache.commons.lang.StringUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilder.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilder.java index 774e2f637c..ea60309a8c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilder.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/querybuilder/HqlQueryBuilder.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.evaluation.querybuilder; import org.apache.commons.logging.Log; @@ -43,7 +52,7 @@ public class HqlQueryBuilder implements QueryBuilder { protected Log log = LogFactory.getLog(getClass()); - private Map> fromTypes = new LinkedHashMap>(); + private Map fromTypes = new LinkedHashMap(); private boolean includeVoided = false; private List columns = new ArrayList(); private List joinClauses = new ArrayList(); @@ -84,13 +93,18 @@ public HqlQueryBuilder from(Class fromType) { } public HqlQueryBuilder from(Class fromType, String fromAlias) { - fromTypes.put(fromAlias, fromType); + fromTypes.put(fromAlias, fromType.getName()); if (!includeVoided && Voidable.class.isAssignableFrom(fromType)) { whereEqual((ObjectUtil.notNull(fromAlias) ? fromAlias + "." : "")+"voided", false); } return this; } + public HqlQueryBuilder from(String entityName, String fromAlias) { + fromTypes.put(fromAlias, entityName); + return this; + } + public HqlQueryBuilder innerJoin(String property, String alias) { joinClauses.add("inner join " + property + " as " + alias); return this; @@ -218,6 +232,17 @@ public HqlQueryBuilder whereInAny(String propertyName, Object... values) { return this; } + public HqlQueryBuilder whereNotInAny(String propertyName, Collection values) { + if (values != null) { + if (values.isEmpty()) { + where("1=1"); + } else { + where(propertyName + " not in (:" + nextPositionIndex() + ")").withValue(values); + } + } + return this; + } + public HqlQueryBuilder wherePatientIn(String propertyName, EvaluationContext context) { if (context != null) { if (context.getBaseCohort() != null) { @@ -434,10 +459,11 @@ public List getColumns(DbSessionFactory sessionFactory) { Query q = buildQuery(sessionFactory); String[] returnAliases = q.getReturnAliases(); Type[] returnTypes = q.getReturnTypes(); - for (int i=0; i parameters) { //***** INSTANCE METHODS ***** public SqlQueryBuilder append(String clause) { - clause = StringUtils.stripComments(clause); + clause = stripComments(clause); queryClauses.add(clause); return this; } + + /** + * Searches through a String which contains SQL code and strips out + * any comments that are between \/**\/ or anything that matches + * SP--SP\n (to support the ANSI standard commenting of -- + * at the end of a line). + * + * Copied from liquibase.util.StringUtils + * + * @return The String without the comments in + */ + private static String stripComments(String multiLineSQL) { + String strippedSingleLines = Pattern.compile("(.*?)\\s*\\-\\-.*\n").matcher(multiLineSQL).replaceAll("$1\n"); + strippedSingleLines = Pattern.compile("(.*?)\\s*\\-\\-.*$").matcher(strippedSingleLines).replaceAll("$1\n"); + return Pattern.compile("/\\*.*?\\*/", Pattern.DOTALL).matcher(strippedSingleLines).replaceAll("").trim(); + } public SqlQueryBuilder addParameter(String parameterName, Object parameterValue) { getParameters().put(parameterName, parameterValue); @@ -99,10 +123,10 @@ public String getSqlQuery() { @Override public List getColumns(DbSessionFactory sessionFactory) { final List l = new ArrayList(); - + try { sessionFactory.getCurrentSession().doWork(new Work() { - + @Override public void execute(Connection connection) throws SQLException { PreparedStatement statement = null; @@ -128,20 +152,20 @@ public void execute(Connection connection) throws SQLException { catch (Exception e) { throw new IllegalArgumentException("Unable to retrieve columns for query", e); } - + return l; } @Override public List evaluateToList(DbSessionFactory sessionFactory, EvaluationContext context) { - + final List ret = new ArrayList(); EvaluationProfiler profiler = new EvaluationProfiler(context); profiler.logBefore("EXECUTING_QUERY", toString()); - + try { sessionFactory.getCurrentSession().doWork(new Work() { - + @Override public void execute(Connection connection) throws SQLException { PreparedStatement statement = null; @@ -174,7 +198,7 @@ public void execute(Connection connection) throws SQLException { profiler.logError("EXECUTING_QUERY", toString(), e); throw new IllegalArgumentException("Unable to execute query", e); } - + profiler.logAfter("EXECUTING_QUERY", "Completed successfully with " + ret.size() + " results"); return ret; } diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationService.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationService.java index fd84973638..27c432c1ee 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationService.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceImpl.java index b731c0bd0e..48c93af159 100644 --- a/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/evaluation/service/EvaluationServiceImpl.java @@ -1,19 +1,15 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.evaluation.service; -import org.openmrs.api.db.hibernate.DbSessionFactory; +import org.openmrs.api.db.hibernate.DbSessionFactory; import org.openmrs.api.context.Context; import org.openmrs.api.impl.BaseOpenmrsService; import org.openmrs.module.reporting.dataset.DataSetColumn; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/BaseIndicator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/BaseIndicator.java index b56626bd0e..0a2c883ee5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/BaseIndicator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/BaseIndicator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicator.java index b9c3356aa1..c8c2d01df9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicatorResult.java b/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicatorResult.java index 9fba3255f2..7e8fbd0a84 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicatorResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/CohortIndicatorResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/Indicator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/Indicator.java index 90d39fd944..3175e47be5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/Indicator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/Indicator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/IndicatorResult.java b/api/src/main/java/org/openmrs/module/reporting/indicator/IndicatorResult.java index 00adfd6ddd..c18ab889e3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/IndicatorResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/IndicatorResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/QueryCountIndicator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/QueryCountIndicator.java index 68ac8b03a1..40f815d93e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/QueryCountIndicator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/QueryCountIndicator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/SimpleIndicatorResult.java b/api/src/main/java/org/openmrs/module/reporting/indicator/SimpleIndicatorResult.java index 1cefd23d0e..c0de09e63d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/SimpleIndicatorResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/SimpleIndicatorResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/SqlIndicator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/SqlIndicator.java index 54d8132488..f063e894f1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/SqlIndicator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/SqlIndicator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/AggregationUtil.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/AggregationUtil.java index ecb7ffb63d..9cc66e8efc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/AggregationUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/AggregationUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/Aggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/Aggregator.java index 29983f4d4b..ddc475af5d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/Aggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/Aggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/CountAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/CountAggregator.java index af76df6e77..9c37610167 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/CountAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/CountAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/DistinctAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/DistinctAggregator.java index c22e92990a..69b30edeca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/DistinctAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/DistinctAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MaxAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MaxAggregator.java index ff6ec53776..b4fedcc58a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MaxAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MaxAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MeanAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MeanAggregator.java index 2ac2c762cb..692147d01a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MeanAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MeanAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MedianAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MedianAggregator.java index 9844083593..490b9dbcfd 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MedianAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MedianAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MinAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MinAggregator.java index 30cd5294e6..fe9378f2eb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MinAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/MinAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/ModeAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/ModeAggregator.java index 81b6c7303f..01832a3367 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/ModeAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/ModeAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/SumAggregator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/SumAggregator.java index 2fd55e99ef..06cdaf57c8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/SumAggregator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/aggregation/SumAggregator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.aggregation; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimension.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimension.java index cda950f85f..67a3486a42 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimension.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimension.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimensionCategory.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimensionCategory.java index ac24f49993..98ae49ea34 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimensionCategory.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDefinitionDimensionCategory.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.dimension; import java.util.Map; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimension.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimension.java index 37aaea061e..dc404c0cce 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimension.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimension.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimensionResult.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimensionResult.java index 9b273d4549..31ed51bc17 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimensionResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortDimensionResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortIndicatorAndDimensionResult.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortIndicatorAndDimensionResult.java index 74aa1e747e..790c8d833d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortIndicatorAndDimensionResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/CohortIndicatorAndDimensionResult.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.dimension; import java.util.HashMap; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/Dimension.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/Dimension.java index 40d1249330..77296afc99 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/Dimension.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/Dimension.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionCategory.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionCategory.java index 015c907a4b..53f7d4f910 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionCategory.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionCategory.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.dimension; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionSet.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionSet.java index 15d1634106..a960e2bf24 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/DimensionSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/CohortDimensionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/CohortDimensionEvaluator.java index 077d877481..961b41dd30 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/CohortDimensionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/CohortDimensionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/DimensionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/DimensionEvaluator.java index ece2151566..9b8b242125 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/DimensionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/evaluator/DimensionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/DimensionPersister.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/DimensionPersister.java index adabcd4305..5d355949ec 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/DimensionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/DimensionPersister.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.dimension.persister; import java.util.List; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/SerializedDimensionPersister.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/SerializedDimensionPersister.java index 6d47598c99..cebcd8bcca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/SerializedDimensionPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/persister/SerializedDimensionPersister.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.indicator.dimension.persister; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionService.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionService.java index e2c3742340..93941aaa27 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionServiceImpl.java index 1d0723400d..419d1cbb11 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/dimension/service/DimensionServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.dimension.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/CohortIndicatorEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/CohortIndicatorEvaluator.java index b7ff2e20da..ac9a072ca9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/CohortIndicatorEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/CohortIndicatorEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.evaluator; @@ -106,7 +102,9 @@ public IndicatorResult evaluate(Indicator indicator, EvaluationContext context) if (cid.getDataToAggregate() != null) { try { PatientDataService pds = Context.getService(PatientDataService.class); - EvaluatedPatientData patientData = pds.evaluate(cid.getDataToAggregate(), context); + EvaluationContext dataContext = context.shallowCopy(); + dataContext.setBaseCohort(cohort); + EvaluatedPatientData patientData = pds.evaluate(cid.getDataToAggregate(), dataContext); for (Integer pId : patientData.getData().keySet()) { result.addLogicResult(pId, (Number) patientData.getData().get(pId)); } @@ -158,4 +156,4 @@ private void maybeSetIndexDate(Object criteria, EvaluationContext context) { } } } -} \ No newline at end of file +} diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/IndicatorEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/IndicatorEvaluator.java index 1e51ccaee2..498514f53d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/IndicatorEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/IndicatorEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/QueryCountIndicatorEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/QueryCountIndicatorEvaluator.java index 59aa9e3047..4136bde50a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/QueryCountIndicatorEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/QueryCountIndicatorEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/SqlIndicatorEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/SqlIndicatorEvaluator.java index 5caeefa867..e227cac450 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/SqlIndicatorEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/evaluator/SqlIndicatorEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/persister/IndicatorPersister.java b/api/src/main/java/org/openmrs/module/reporting/indicator/persister/IndicatorPersister.java index 2e39b9407d..15c7c3855b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/persister/IndicatorPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/persister/IndicatorPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/persister/SerializedIndicatorPersister.java b/api/src/main/java/org/openmrs/module/reporting/indicator/persister/SerializedIndicatorPersister.java index 5f149c7843..c660c9c208 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/persister/SerializedIndicatorPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/persister/SerializedIndicatorPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorService.java b/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorService.java index 0655c2f016..6dde025ccc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorService.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorServiceImpl.java index 9fccd0e7e0..fa49ea4ce5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/service/IndicatorServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/indicator/util/IndicatorUtil.java b/api/src/main/java/org/openmrs/module/reporting/indicator/util/IndicatorUtil.java index 91051983e7..901f4491ca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/indicator/util/IndicatorUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/indicator/util/IndicatorUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.indicator.util; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/CohortDefinitionEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/CohortDefinitionEditor.java index 84743721fc..61f5cc0727 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/CohortDefinitionEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/CohortDefinitionEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.propertyeditor; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/DataSetDefinitionEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/DataSetDefinitionEditor.java index ae99acac88..6c0e3d194f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/DataSetDefinitionEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/DataSetDefinitionEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.propertyeditor; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/IndicatorEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/IndicatorEditor.java index 37b3103c5d..cdeb4bfa02 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/IndicatorEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/IndicatorEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.propertyeditor; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/MappedEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/MappedEditor.java index f80da6633e..c65c014b3d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/MappedEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/MappedEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.propertyeditor; import java.beans.PropertyEditorSupport; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/RenderingModeEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/RenderingModeEditor.java index b99fc3fbf9..347cb12f1a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/RenderingModeEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/RenderingModeEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.propertyeditor; import java.beans.PropertyEditorSupport; diff --git a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/ReportDefinitionEditor.java b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/ReportDefinitionEditor.java index 877ec170d3..f13deda6f3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/propertyeditor/ReportDefinitionEditor.java +++ b/api/src/main/java/org/openmrs/module/reporting/propertyeditor/ReportDefinitionEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.propertyeditor; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/BaseIdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/BaseIdSet.java index 4e0d54c477..077146c21c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/BaseIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/BaseIdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/BaseQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/BaseQuery.java index 2dceb28ed8..ea059815af 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/BaseQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/BaseQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/BaseSqlQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/BaseSqlQuery.java index 4166a27230..6d017703dc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/BaseSqlQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/BaseSqlQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/CompositionQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/CompositionQuery.java index 369639104c..3da6cbc558 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/CompositionQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/CompositionQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/IdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/IdSet.java index 1dc09c15f0..195e31a05a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/IdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/IdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/MappedParametersQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/MappedParametersQuery.java index 6b92ddca30..4924f87cff 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/MappedParametersQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/MappedParametersQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query; import org.openmrs.OpenmrsObject; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/Query.java b/api/src/main/java/org/openmrs/module/reporting/query/Query.java index ca0cc8ab17..5899825b86 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/Query.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/Query.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/QueryUtil.java b/api/src/main/java/org/openmrs/module/reporting/query/QueryUtil.java index c8739f62a5..b6905bbfac 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/QueryUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/QueryUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterIdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterIdSet.java index 4e796d7c17..a870e0f550 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterIdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterQueryResult.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterQueryResult.java index 877506ce3d..e103bf4f70 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterQueryResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/EncounterQueryResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AllEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AllEncounterQuery.java index 04c2e64a5a..b6f56b064a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AllEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AllEncounterQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AuditEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AuditEncounterQuery.java index b88921199e..291df2f288 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AuditEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/AuditEncounterQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/BasicEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/BasicEncounterQuery.java index 79dd933d07..4f0eb481ca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/BasicEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/BasicEncounterQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CodedObsForEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CodedObsForEncounterQuery.java index ce5f73c13b..85f7cd85ca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CodedObsForEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CodedObsForEncounterQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Concept; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CompositionEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CompositionEncounterQuery.java index 5452e66ce3..a123c776ca 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CompositionEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/CompositionEncounterQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ConditionalParameterEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ConditionalParameterEncounterQuery.java index 494a3cac3d..b74c8448cc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ConditionalParameterEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ConditionalParameterEncounterQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/EncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/EncounterQuery.java index 17b501526c..f186c356c7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/EncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/EncounterQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MappedParametersEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MappedParametersEncounterQuery.java index 8f716aa2b8..f8bd5b6315 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MappedParametersEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MappedParametersEncounterQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MostRecentEncounterForPatientQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MostRecentEncounterForPatientQuery.java index 16f9a3113e..12b283aa57 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MostRecentEncounterForPatientQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/MostRecentEncounterForPatientQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/NumericObsForEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/NumericObsForEncounterQuery.java index 8413dfc4b5..196e102d26 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/NumericObsForEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/NumericObsForEncounterQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.module.reporting.common.RangeComparator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ObsForEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ObsForEncounterQuery.java index 22a688d120..f7cc04e8c8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ObsForEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/ObsForEncounterQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.definition; import org.openmrs.Concept; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/PatientEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/PatientEncounterQuery.java index a67d5100ff..c74e0bb145 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/PatientEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/PatientEncounterQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/SqlEncounterQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/SqlEncounterQuery.java index 3c29853d48..aea504f0b7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/SqlEncounterQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/definition/SqlEncounterQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AllEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AllEncounterQueryEvaluator.java index ff6a3c5241..c944b11a4c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AllEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AllEncounterQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluator.java index 93fd7b4be9..f0eacd92d0 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/AuditEncounterQueryEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluator.java index dd9d7e45f7..61e972b001 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/BasicEncounterQueryEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.openmrs.Encounter; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluator.java index 34876e7c60..b0025e8e3d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/CompositionEncounterQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluator.java index b29fe49a69..4c25f968fb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ConditionalParameterEncounterQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/EncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/EncounterQueryEvaluator.java index fe23dba68d..824a425162 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/EncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/EncounterQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluator.java index 122ef9c39f..050f8895f3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MappedParametersEncounterQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.encounter.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluator.java index a5ab5c7a4e..efa46ecd86 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/MostRecentEncounterForPatientQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluator.java index 94f90b9dea..73dc519b2a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/ObsForEncounterQueryEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.encounter.evaluator; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/PatientEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/PatientEncounterQueryEvaluator.java index 1a76c9c78d..78248b673a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/PatientEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/PatientEncounterQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluator.java index f9218235fc..f6bf041d22 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/evaluator/SqlEncounterQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/persister/SerializedEncounterQueryPersister.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/persister/SerializedEncounterQueryPersister.java index ce54ad348f..ddefac2863 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/persister/SerializedEncounterQueryPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/persister/SerializedEncounterQueryPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryService.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryService.java index 1f26e63b91..73b59a0713 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImpl.java index b3fa460c84..2cb5d02fa6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/encounter/service/EncounterQueryServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.encounter.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/evaluator/CompositionQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/evaluator/CompositionQueryEvaluator.java index a4690d7d3b..f83afc2e49 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/evaluator/CompositionQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/evaluator/CompositionQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsIdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsIdSet.java index 076a3ec34a..10f2e3b1ac 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsIdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsQueryResult.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsQueryResult.java index 543f3fcb7b..d0f26eec0d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsQueryResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/ObsQueryResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/AllObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/AllObsQuery.java index 3eb92b2429..fe4418485a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/AllObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/AllObsQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.definition; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/BasicObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/BasicObsQuery.java index 93562598f1..4a3e70c6fc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/BasicObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/BasicObsQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.definition; import org.openmrs.Concept; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/MappedParametersObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/MappedParametersObsQuery.java index 41d06b2e33..932b727003 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/MappedParametersObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/MappedParametersObsQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.definition; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/ObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/ObsQuery.java index 5c997a4a81..f660b55a9c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/ObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/ObsQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/PatientObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/PatientObsQuery.java index 587c0e0cf1..9b8d631954 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/PatientObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/PatientObsQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.definition; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/SqlObsQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/SqlObsQuery.java index 11c47c0e69..1c245ad123 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/SqlObsQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/definition/SqlObsQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluator.java index 508371abeb..61d1947899 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/AllObsQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluator.java index ca066eab13..dc15e29d32 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/BasicObsQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.evaluator; import org.openmrs.Obs; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/MappedParametersObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/MappedParametersObsQueryEvaluator.java index 4a8aa27391..0ccf7ff929 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/MappedParametersObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/MappedParametersObsQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.evaluator; import org.openmrs.annotation.Handler; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/ObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/ObsQueryEvaluator.java index ddfef0a24b..42206ae669 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/ObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/ObsQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/PatientObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/PatientObsQueryEvaluator.java index 827747cc11..1c6d853dcb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/PatientObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/PatientObsQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.obs.evaluator; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluator.java index c2666d5f25..d00e349b03 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/evaluator/SqlObsQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/persister/SerializedObsQueryPersister.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/persister/SerializedObsQueryPersister.java index 8dda111ef1..ccb81d443b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/persister/SerializedObsQueryPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/persister/SerializedObsQueryPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryService.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryService.java index 645a5810df..19f9631042 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImpl.java index 02b15ac189..b19d26976c 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/obs/service/ObsQueryServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.obs.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/PersonIdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/person/PersonIdSet.java index 89a14918f4..1ec4b3686b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/PersonIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/PersonIdSet.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/PersonQueryResult.java b/api/src/main/java/org/openmrs/module/reporting/query/person/PersonQueryResult.java index 432a1992d3..9286791928 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/PersonQueryResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/PersonQueryResult.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/AllPersonQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/AllPersonQuery.java index aaa61e89bb..8e70946105 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/AllPersonQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/AllPersonQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PatientPersonQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PatientPersonQuery.java index 2d0342b9cf..5b3de3f16f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PatientPersonQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PatientPersonQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PersonQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PersonQuery.java index 3ff1e4cf6c..09c4fcc74a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PersonQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/PersonQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/SqlPersonQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/SqlPersonQuery.java index ea803f662b..6f3407aa39 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/definition/SqlPersonQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/definition/SqlPersonQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluator.java index 55cc9d0241..5d3dd61796 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/AllPersonQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluator.java index cd62395598..9503459c0d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PatientPersonQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PersonQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PersonQueryEvaluator.java index 8d98f6b43f..9b297aa8f7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PersonQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/PersonQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluator.java index 0b807758ed..52c4e3f55e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/evaluator/SqlPersonQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/persister/SerializedPersonQueryPersister.java b/api/src/main/java/org/openmrs/module/reporting/query/person/persister/SerializedPersonQueryPersister.java index 6e9096a4c3..472786e9cf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/persister/SerializedPersonQueryPersister.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/persister/SerializedPersonQueryPersister.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.persister; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryService.java b/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryService.java index b0bc583b71..544924c5c1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImpl.java index 4c47573e8c..fae297563e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/person/service/PersonQueryServiceImpl.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.person.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitIdSet.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitIdSet.java index 29a61621f5..97aa129390 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitIdSet.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitIdSet.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit; import java.util.List; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitQueryResult.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitQueryResult.java index f07507c36c..5dcd483db7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitQueryResult.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/VisitQueryResult.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit; import org.openmrs.module.reporting.evaluation.Evaluated; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/ActiveVisitQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/ActiveVisitQuery.java index f7b4fdf55b..802e02b1bc 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/ActiveVisitQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/ActiveVisitQuery.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit.definition; import org.openmrs.Visit; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/AllVisitQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/AllVisitQuery.java index 13446d7684..4f6d804cc4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/AllVisitQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/AllVisitQuery.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.visit.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/BasicVisitQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/BasicVisitQuery.java index 53d8834c04..8b597a4b22 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/BasicVisitQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/BasicVisitQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.visit.definition; import java.util.ArrayList; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/VisitQuery.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/VisitQuery.java index dd2c06aa3b..26fa139c00 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/VisitQuery.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/definition/VisitQuery.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.visit.definition; import org.openmrs.Visit; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluator.java index ad7004cd61..902a9082bb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/ActiveVisitQueryEvaluator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit.evaluator; import org.openmrs.Visit; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/AllVisitQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/AllVisitQueryEvaluator.java index c875eed1f0..60df5ca1a5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/AllVisitQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/AllVisitQueryEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.query.visit.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluator.java index fe787e51aa..4366acac3b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/BasicVisitQueryEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.visit.evaluator; import java.util.List; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/VisitQueryEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/VisitQueryEvaluator.java index 176e511034..227aebf7d6 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/VisitQueryEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/evaluator/VisitQueryEvaluator.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.query.visit.evaluator; import org.openmrs.module.reporting.definition.evaluator.DefinitionEvaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryService.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryService.java index 38b5eda614..822efa7c6f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryService.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryService.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit.service; import org.openmrs.module.reporting.definition.service.DefinitionService; diff --git a/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryServiceImpl.java index 72385bec64..83e7783fe7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/query/visit/service/VisitQueryServiceImpl.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.query.visit.service; import org.openmrs.module.reporting.definition.service.DefinitionService; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/Report.java b/api/src/main/java/org/openmrs/module/reporting/report/Report.java index 12d0a37fce..9cdaa56752 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/Report.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/Report.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report; import org.openmrs.module.reporting.report.renderer.ReportRenderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/ReportData.java b/api/src/main/java/org/openmrs/module/reporting/report/ReportData.java index 7861e8adff..efcd9a8364 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/ReportData.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/ReportData.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/ReportDesign.java b/api/src/main/java/org/openmrs/module/reporting/report/ReportDesign.java index 3606f5df81..9b9ad99c40 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/ReportDesign.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/ReportDesign.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/ReportDesignResource.java b/api/src/main/java/org/openmrs/module/reporting/report/ReportDesignResource.java index 28fa26e938..6e1f71aa49 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/ReportDesignResource.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/ReportDesignResource.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/ReportProcessorConfiguration.java b/api/src/main/java/org/openmrs/module/reporting/report/ReportProcessorConfiguration.java index 72cf8617e8..84b2a991af 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/ReportProcessorConfiguration.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/ReportProcessorConfiguration.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/ReportRequest.java b/api/src/main/java/org/openmrs/module/reporting/report/ReportRequest.java index b2019b9eaf..4a20b510eb 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/ReportRequest.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/ReportRequest.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report; import org.openmrs.BaseOpenmrsObject; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/BaseReportDefinition.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/BaseReportDefinition.java index d4fd694d4e..a80b66e5ae 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/BaseReportDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/BaseReportDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/PeriodIndicatorReportDefinition.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/PeriodIndicatorReportDefinition.java index 7e88f37656..5680cb97e8 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/PeriodIndicatorReportDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/PeriodIndicatorReportDefinition.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.definition; import java.util.HashMap; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/ReportDefinition.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/ReportDefinition.java index 896735bf8f..8fd4653a5d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/ReportDefinition.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/ReportDefinition.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/DefaultReportDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/DefaultReportDefinitionEvaluator.java index 6a56963d8f..b33216f43f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/DefaultReportDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/DefaultReportDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/ReportDefinitionEvaluator.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/ReportDefinitionEvaluator.java index eca7167a5e..9ee7a64d7a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/ReportDefinitionEvaluator.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/evaluator/ReportDefinitionEvaluator.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition.evaluator; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionService.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionService.java index e0c96524e4..9d35176d5f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionService.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.definition.service; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImpl.java index c41157cf33..4bd37b67d4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/definition/service/ReportDefinitionServiceImpl.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.definition.service; import org.openmrs.api.APIException; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/manager/BaseReportManager.java b/api/src/main/java/org/openmrs/module/reporting/report/manager/BaseReportManager.java index e5332f77ec..e2be48d44f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/manager/BaseReportManager.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/manager/BaseReportManager.java @@ -1,17 +1,12 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.report.manager; import org.openmrs.module.reporting.evaluation.parameter.Parameter; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManager.java b/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManager.java index 6120d8d215..76e4353daf 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManager.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManager.java @@ -1,15 +1,11 @@ -/* - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.manager; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManagerUtil.java b/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManagerUtil.java index 25b39bb9ec..37b7d429f5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManagerUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/manager/ReportManagerUtil.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.manager; @@ -26,6 +22,7 @@ import org.openmrs.module.reporting.report.definition.ReportDefinition; import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; import org.openmrs.module.reporting.report.renderer.CsvReportRenderer; +import org.openmrs.module.reporting.report.renderer.TextTemplateRenderer; import org.openmrs.module.reporting.report.renderer.XlsReportRenderer; import org.openmrs.module.reporting.report.service.ReportService; import org.openmrs.module.reporting.report.util.ReportUtil; @@ -163,6 +160,23 @@ public static ReportDesign createExcelTemplateDesign(String reportDesignUuid, Re return design; } + /** + * @return a new ReportDesign for a JSON template, using a file on the classpath as the template + */ + public static ReportDesign createJSONTemplateDesign(String reportDesignUuid, ReportDefinition reportDefinition, String resourcePath) { + ReportDesign design = createJSONReportDesign(reportDesignUuid,reportDefinition); + design.setReportDefinition(reportDefinition); + design.setRendererType(TextTemplateRenderer.class); + ReportDesignResource resource = new ReportDesignResource(); + resource.setName("template"); + resource.setExtension("json"); + resource.setContentType("application/json"); + resource.setContents(ReportUtil.readByteArrayFromResource(resourcePath)); + resource.setReportDesign(design); + design.addResource(resource); + return design; + } + /** * @return a new ReportDesign for a standard Excel output */ @@ -187,4 +201,16 @@ public static ReportDesign createCsvReportDesign(String reportDesignUuid, Report design.setRendererType(CsvReportRenderer.class); return design; } + + /** + * @return a new ReportDesign for a standard CSV output + */ + public static ReportDesign createJSONReportDesign(String reportDesignUuid, ReportDefinition reportDefinition) { + ReportDesign design = new ReportDesign(); + design.setUuid(reportDesignUuid); + design.setName("JSON"); + design.setReportDefinition(reportDefinition); + design.setRendererType(TextTemplateRenderer.class); + return design; + } } diff --git a/api/src/main/java/org/openmrs/module/reporting/report/processor/DiskReportProcessor.java b/api/src/main/java/org/openmrs/module/reporting/report/processor/DiskReportProcessor.java index 13c67c8a47..d5be4ec0e3 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/processor/DiskReportProcessor.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/processor/DiskReportProcessor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.processor; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/processor/EmailReportProcessor.java b/api/src/main/java/org/openmrs/module/reporting/report/processor/EmailReportProcessor.java index 916c0d7b38..502e676705 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/processor/EmailReportProcessor.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/processor/EmailReportProcessor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.processor; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/processor/LoggingReportProcessor.java b/api/src/main/java/org/openmrs/module/reporting/report/processor/LoggingReportProcessor.java index 717411c4cb..dd97d78882 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/processor/LoggingReportProcessor.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/processor/LoggingReportProcessor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.processor; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/processor/ReportProcessor.java b/api/src/main/java/org/openmrs/module/reporting/report/processor/ReportProcessor.java index 2aed229af9..ee1cc443e1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/processor/ReportProcessor.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/processor/ReportProcessor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.processor; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/AbstractReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/AbstractReportRenderer.java index 0061944af4..e95e9c346e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/AbstractReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/AbstractReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRenderer.java index aaca2b6d4a..da2eb0ebbe 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/CohortDetailReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/CsvReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/CsvReportRenderer.java index 45896c83b8..b279f88c24 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/CsvReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/CsvReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRenderer.java index 3a1ab62116..ef9f9feb3b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/DelimitedTextReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRenderer.java index a6445876e9..237edd1209 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ExcelTemplateRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/IndicatorReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/IndicatorReportRenderer.java index 05c2811fde..756531d990 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/IndicatorReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/IndicatorReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/InteractiveReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/InteractiveReportRenderer.java index c2ad92494b..f936183848 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/InteractiveReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/InteractiveReportRenderer.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.renderer; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingException.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingException.java index 5992865392..8a7f94cbc5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingException.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingMode.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingMode.java index 72043af260..7169354e2e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingMode.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/RenderingMode.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportDesignRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportDesignRenderer.java index 5fda86db18..0bc18f37d5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportDesignRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportDesignRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRenderer.java index 7a27d9d61e..735c780629 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRendererException.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRendererException.java index afdc437724..d3aabd4002 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRendererException.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportRendererException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportTemplateRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportTemplateRenderer.java index 25ab07f2db..121c393a95 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportTemplateRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/ReportTemplateRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; @@ -226,17 +222,19 @@ public Map getReplacementData(ReportData reportData, ReportDesig * @return the value for the report template replacement given the initial value */ public Object getReplacementValue(Object initialValue) { + Object replacementValue = ""; - if (initialValue != null) { - if (initialValue instanceof Cohort) { - replacementValue = new Integer(((Cohort) initialValue).size()); - } - else if (initialValue instanceof IndicatorResult) { - replacementValue = new Double(((IndicatorResult) initialValue).getValue().doubleValue()); - } - else { - replacementValue = initialValue; - } + if (initialValue != null) { + if (initialValue instanceof Cohort) { + replacementValue = new Integer(((Cohort) initialValue).size()); + } + else if (initialValue instanceof IndicatorResult) { + IndicatorResult ir = (IndicatorResult) initialValue; + replacementValue = ir.getValue(); + } + else { + replacementValue = initialValue; + } } return replacementValue; } diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/SimpleHtmlReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/SimpleHtmlReportRenderer.java index 0cd96afab0..a5f3f845db 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/SimpleHtmlReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/SimpleHtmlReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/TextTemplateRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/TextTemplateRenderer.java index cc1a7dba9a..731cbb6815 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/TextTemplateRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/TextTemplateRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/TsvReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/TsvReportRenderer.java index 59dc47d755..968a824359 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/TsvReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/TsvReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/XlsReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/XlsReportRenderer.java index ac59dd1f92..edbebe7390 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/XlsReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/XlsReportRenderer.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.renderer; import org.apache.commons.io.IOUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/XmlReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/XmlReportRenderer.java index 918aeb9e73..855351a2ce 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/XmlReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/XmlReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/GroovyTemplateEngine.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/GroovyTemplateEngine.java index d9fda41427..604d538578 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/GroovyTemplateEngine.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/GroovyTemplateEngine.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer.template; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngine.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngine.java index 40e4186f9f..a51e74f77a 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngine.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngine.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer.template; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngineManager.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngineManager.java index 4a97e5f5d7..299de8b151 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngineManager.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEngineManager.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer.template; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEvaluationException.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEvaluationException.java index cb675ff876..b88b488c10 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEvaluationException.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/TemplateEvaluationException.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer.template; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/VelocityTemplateEngine.java b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/VelocityTemplateEngine.java index a588e2d5f4..a56180148d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/VelocityTemplateEngine.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/renderer/template/VelocityTemplateEngine.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.renderer.template; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/service/ReportService.java b/api/src/main/java/org/openmrs/module/reporting/report/service/ReportService.java index 7b02ccc6e3..5e4b2400c4 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/service/ReportService.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/ReportService.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.service; @@ -131,6 +127,16 @@ public interface ReportService extends OpenmrsService { public ReportRequest getReportRequestByUuid(String uuid); /** + * Get Report Requests by Report Definition, request date, having given status. + * The list is sorted descending by evaluateCompleteDatetime, evaluateStartDatetime, priority, requestDate. + * + * @param reportDefinition a Report Definition filter, nullable + * @param requestOnOrAfter a Date used to limit result to ReportRequests which ware requested on or after + * (greater or equal filter), nullable + * @param requestOnOrBefore a Date used to limit result to ReportRequests which ware requested on or before + * (lower or equal filter), nullable + * @param statuses an array of Status, used to limit result to ReportRequests with status included in the array, null + * or empty array means that all statuses are included, nullable * @return all {@link ReportRequest} in the system that match the passed parameters * @should retrieve report requests by definition */ @@ -138,12 +144,58 @@ public interface ReportService extends OpenmrsService { public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status...statuses); /** + * Get Report Requests by Report Definition, request date, having given status, limit result to at most {@code + * mostRecentNum} elements. + * The list is sorted descending by evaluateCompleteDatetime, evaluateStartDatetime, priority, requestDate. + * + * @param reportDefinition a Report Definition filter, nullable + * @param requestOnOrAfter a Date used to limit result to ReportRequests which ware requested on or after + * (greater or equal filter), nullable + * @param requestOnOrBefore a Date used to limit result to ReportRequests which ware requested on or before + * (lower or equal filter), nullable + * @param mostRecentNum maximum number of results, a null value means all records are to be returned, nullable + * @param statuses an array of Status, used to limit result to ReportRequests with status included in the array, null + * or empty array means that all statuses are included, nullable * @return all {@link ReportRequest} in the system that match the passed parameters * @should retrieve report requests by definition */ @Transactional(readOnly = true) public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer mostRecentNum, Status...statuses); + /** + * Get Report Requests by Report Definition, request date, having given status. + * The list is sorted descending by evaluateCompleteDatetime, evaluateStartDatetime, priority, requestDate. + * + * @param reportDefinition a Report Definition filter, nullable + * @param requestOnOrAfter a Date used to limit result to ReportRequests which ware requested on or after + * (greater or equal filter), nullable + * @param requestOnOrBefore a Date used to limit result to ReportRequests which ware requested on or before + * (lower or equal filter), nullable + * @param firstResult the first result to be retrieved, nullable + * @param maxResults a limit upon the number of Report Requests to be retrieved, nullable + * @param statuses an array of Status, used to limit result to ReportRequests with status included in the array, null + * or empty array means that all statuses are included, nullable + * @return all {@link ReportRequest} in the system that match the passed parameters + * @since 1.27.0 + */ + @Transactional(readOnly = true) + public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer firstResult, Integer maxResults, Status...statuses); + + /** + * Gets a count of Report Requests that match by Report Definition, request date limits and status(-es). + * + * @param reportDefinition a Report Definition filter, nullable + * @param requestOnOrAfter a Date used to limit result to ReportRequests which ware requested on or after + * (greater or equal filter), nullable + * @param requestOnOrBefore a Date used to limit result to ReportRequests which ware requested on or before + * (lower or equal filter), nullable + * @param statuses an array of Status, used to limit result to ReportRequests with status included in the array, null + * or empty array means that all statuses are included, nullable + * @return the count of Report Requests that match the passed parameters + * @since 1.27.0 + */ + public long getReportRequestsCount(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status...statuses); + /** * Deletes the passed {@link ReportRequest} */ diff --git a/api/src/main/java/org/openmrs/module/reporting/report/service/ReportServiceImpl.java b/api/src/main/java/org/openmrs/module/reporting/report/service/ReportServiceImpl.java index 98a27e505c..394ab83b0e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/service/ReportServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/ReportServiceImpl.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.service; import org.apache.commons.io.FileUtils; @@ -211,7 +220,22 @@ public List getReportRequests(ReportDefinition reportDefinition, */ @Transactional(readOnly=true) public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer mostRecentNum, Status...statuses) { - return reportDAO.getReportRequests(reportDefinition, requestOnOrAfter, requestOnOrBefore, mostRecentNum, statuses); + return getReportRequests(reportDefinition, requestOnOrAfter, requestOnOrBefore, 0, mostRecentNum, statuses); + } + + /** + * @see ReportService#getReportRequests(ReportDefinition, Date, Date, Integer, Integer, Status...) + */ + @Override + @Transactional(readOnly = true) + public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer firstResult, Integer maxResults, Status... statuses) { + return reportDAO.getReportRequests(reportDefinition, requestOnOrAfter, requestOnOrBefore, firstResult, maxResults, statuses); + } + + @Override + @Transactional(readOnly = true) + public long getReportRequestsCount(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status... statuses) { + return reportDAO.getReportRequestsCount(reportDefinition, requestOnOrAfter, requestOnOrBefore, statuses); } /** @@ -829,4 +853,4 @@ public void setReportData(ReportData reportData) { this.reportData = reportData; } } -} \ No newline at end of file +} diff --git a/api/src/main/java/org/openmrs/module/reporting/report/service/db/HibernateReportDAO.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/HibernateReportDAO.java index bc693dd364..0dfd4db6b5 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/service/db/HibernateReportDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/HibernateReportDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.service.db; @@ -19,6 +15,7 @@ import org.hibernate.Query; import org.hibernate.criterion.Expression; import org.hibernate.criterion.Order; +import org.hibernate.criterion.Projections; import org.hibernate.criterion.Restrictions; import org.openmrs.api.db.DAOException; import org.openmrs.api.db.hibernate.DbSessionFactory; @@ -191,34 +188,35 @@ public ReportRequest getReportRequestByUuid(String uuid) { } /** - * @see ReportDAO#getReportRequests(ReportDefinition, Date, Date, Integer, Status...) + * @see ReportDAO#getReportRequests(ReportDefinition, Date, Date, Integer, Integer, Status...) */ @SuppressWarnings("unchecked") - public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer mostRecentNum, Status...statuses) { - Criteria c = sessionFactory.getCurrentSession().createCriteria(ReportRequest.class); - if (reportDefinition != null) { - c.add(Restrictions.eq("reportDefinition.definition", reportDefinition.getUuid())); - } - if (requestOnOrAfter != null) { - c.add(Restrictions.ge("requestDate", requestOnOrAfter)); - } - if (requestOnOrBefore != null) { - c.add(Restrictions.le("requestDate", requestOnOrBefore)); - } - if (statuses != null && statuses.length > 0) { - c.add(Restrictions.in("status", statuses)); + public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer firstResult, Integer maxResults, Status...statuses) { + final Criteria criteria = createReportRequestsBaseCriteria(reportDefinition, requestOnOrAfter, requestOnOrBefore, statuses); + + criteria.addOrder(Order.desc("requestDate")); + criteria.addOrder(Order.desc("evaluateStartDatetime")); + criteria.addOrder(Order.desc("evaluateCompleteDatetime")); + criteria.addOrder(Order.desc("priority")); + + if (firstResult != null) { + criteria.setFirstResult(firstResult); } - c.addOrder(Order.desc("evaluateCompleteDatetime")); - c.addOrder(Order.desc("evaluateStartDatetime")); - c.addOrder(Order.desc("priority")); - c.addOrder(Order.desc("requestDate")); - if (mostRecentNum != null) { - c.setMaxResults(mostRecentNum); + if(maxResults != null) { + criteria.setMaxResults(maxResults); } - return c.list(); + + return criteria.list(); } - + + @Override + public long getReportRequestsCount(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status... statuses) { + final Criteria criteria = createReportRequestsBaseCriteria(reportDefinition, requestOnOrAfter, requestOnOrBefore, statuses); + criteria.setProjection(Projections.rowCount()); + return ((Number) criteria.uniqueResult()).longValue(); + } + /** * @see ReportDAO#purgeReportRequest(ReportRequest) */ @@ -275,5 +273,24 @@ public DbSessionFactory getSessionFactory() { public void setSessionFactory(DbSessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } + + private Criteria createReportRequestsBaseCriteria(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status... statuses) { + Criteria criteria = sessionFactory.getCurrentSession().createCriteria(ReportRequest.class); + + if (reportDefinition != null) { + criteria.add(Restrictions.eq("reportDefinition.definition", reportDefinition.getUuid())); + } + if (requestOnOrAfter != null) { + criteria.add(Restrictions.ge("requestDate", requestOnOrAfter)); + } + if (requestOnOrBefore != null) { + criteria.add(Restrictions.le("requestDate", requestOnOrBefore)); + } + if (statuses != null && statuses.length > 0) { + criteria.add(Restrictions.in("status", statuses)); + } + + return criteria; + } } diff --git a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java similarity index 80% rename from api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java rename to api/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java index f36a4f14dd..be83b0e291 100644 --- a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/MappedDefinitionType.java @@ -1,212 +1,209 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import org.apache.commons.lang.StringUtils; -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.type.Type; -import org.hibernate.usertype.CompositeUserType; -import org.hibernate.usertype.ParameterizedType; -import org.hibernate.usertype.UserType; -import org.openmrs.api.context.Context; -import org.openmrs.module.reporting.common.HibernateUtil; -import org.openmrs.module.reporting.definition.DefinitionContext; -import org.openmrs.module.reporting.evaluation.Definition; -import org.openmrs.module.reporting.evaluation.parameter.Mapped; -import org.openmrs.module.reporting.evaluation.parameter.Parameterizable; -import org.openmrs.module.reporting.serializer.ReportingSerializer; - -/** - * Custom User-Type for storing Mapped objects in a single table within 2 columns - * This type takes in 2 properties and 1 parameter in the form: - *

- *		
- *			
- *			
- *			
- *				org.openmrs.module.reporting.report.definition.ReportDefinition
- *			
- *		
- * 
- */ -@SuppressWarnings({"rawtypes", "unchecked"}) -public class MappedDefinitionType implements CompositeUserType, ParameterizedType { - - /** - * Property via ParameterizedType for storing the type of the Mapped Parameterizable - */ - private Class mappedType; - - /** - * @see CompositeUserType#returnedClass() - */ - public Class returnedClass() { - return Mapped.class; - } - - /** - * @see CompositeUserType#getPropertyNames() - */ - public String[] getPropertyNames() { - return new String[] {"definition", "parameterMappings"}; - } - - /** - * @see CompositeUserType#getPropertyTypes() - */ - public Type[] getPropertyTypes() { - return new Type[] { HibernateUtil.standardType("STRING"), HibernateUtil.standardType("TEXT") }; - } - - /** - * @see CompositeUserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see CompositeUserType#getPropertyValue(java.lang.Object, int) - */ - public Object getPropertyValue(Object component, int property) throws HibernateException { - Mapped m = (Mapped) component; - return (property == 0 ? m.getParameterizable() : m.getParameterMappings()); - } - - /** - * @see CompositeUserType#setPropertyValue(java.lang.Object, int, java.lang.Object) - */ - public void setPropertyValue(Object component, int property, Object value) throws HibernateException { - Mapped m = (Mapped) component; - if (property == 0) { - m.setParameterizable((Parameterizable)value); - } - else { - m.setParameterMappings((Map)value); - } - } - - /** - * @see CompositeUserType#deepCopy(java.lang.Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value == null) return null; - Mapped toCopy = (Mapped) value; - Mapped m = new Mapped(); - m.setParameterizable(toCopy.getParameterizable()); - m.setParameterMappings(new HashMap(toCopy.getParameterMappings())); - return m; - } - - /** - * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - String parameterizableUuid = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[0], session, owner); - if (StringUtils.isEmpty(parameterizableUuid)) { return null; } - String serializedMappings = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); - Definition d = DefinitionContext.getDefinitionByUuid(mappedType, parameterizableUuid); - Map mappings = new HashMap(); - if (StringUtils.isNotBlank(serializedMappings)) { - try { - mappings = Context.getSerializationService().deserialize(serializedMappings, Map.class, ReportingSerializer.class); - } - catch (Exception e) { - throw new HibernateException("Unable to deserialize parameter mappings for definition", e); - } - } - return new Mapped(d, mappings); - } - - /** - * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - String definitionUuid = null; - String serializedMappings = null; - if (value != null) { - Mapped m = (Mapped) value; - if (m.getParameterizable() != null) { - definitionUuid = m.getParameterizable().getUuid(); - if (m.getParameterMappings() != null && !m.getParameterMappings().isEmpty()) { - try { - serializedMappings = Context.getSerializationService().serialize(m.getParameterMappings(), ReportingSerializer.class); - } - catch (Exception e) { - throw new HibernateException("Unable to serialize mappings for definition", e); - } - } - } - } - HibernateUtil.standardType("STRING").nullSafeSet(st, definitionUuid, index, session); - HibernateUtil.standardType("STRING").nullSafeSet(st, serializedMappings, index+1, session); - } - - /** - * @see CompositeUserType#replace(Object, Object, SessionImplementor, Object) - */ - public Object replace(Object original, Object target, SessionImplementor session, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see CompositeUserType#disassemble(Object, SessionImplementor) - */ - public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException { - return (Serializable) deepCopy(value); - } - - /** - * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) - */ - public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException { - return deepCopy(cached); - } - - /** - * @see ParameterizedType#setParameterValues(Properties) - */ - public void setParameterValues(Properties parameters) { - String mappedTypeStr = parameters.getProperty("mappedType"); - try { - mappedType = (Class)Context.loadClass(mappedTypeStr); - } - catch (Exception e) { - throw new HibernateException("Error setting the mappedType property to " + mappedTypeStr, e); - } - } +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.report.service.db; + +import org.apache.commons.lang.StringUtils; +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.Type; +import org.hibernate.usertype.CompositeUserType; +import org.hibernate.usertype.ParameterizedType; +import org.hibernate.usertype.UserType; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.common.HibernateUtil; +import org.openmrs.module.reporting.definition.DefinitionContext; +import org.openmrs.module.reporting.evaluation.Definition; +import org.openmrs.module.reporting.evaluation.parameter.Mapped; +import org.openmrs.module.reporting.evaluation.parameter.Parameterizable; +import org.openmrs.module.reporting.serializer.ReportingSerializer; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * Custom User-Type for storing Mapped objects in a single table within 2 columns + * This type takes in 2 properties and 1 parameter in the form: + *
+ *		
+ *			
+ *			
+ *			
+ *				org.openmrs.module.reporting.report.definition.ReportDefinition
+ *			
+ *		
+ * 
+ */ +@SuppressWarnings({"rawtypes", "unchecked"}) +public class MappedDefinitionType implements CompositeUserType, ParameterizedType { + + /** + * Property via ParameterizedType for storing the type of the Mapped Parameterizable + */ + private Class mappedType; + + /** + * @see CompositeUserType#returnedClass() + */ + public Class returnedClass() { + return Mapped.class; + } + + /** + * @see CompositeUserType#getPropertyNames() + */ + public String[] getPropertyNames() { + return new String[] {"definition", "parameterMappings"}; + } + + /** + * @see CompositeUserType#getPropertyTypes() + */ + public Type[] getPropertyTypes() { + return new Type[] { HibernateUtil.standardType("STRING"), HibernateUtil.standardType("TEXT") }; + } + + /** + * @see CompositeUserType#isMutable() + */ + public boolean isMutable() { + return true; + } + + /** + * @see CompositeUserType#getPropertyValue(Object, int) + */ + public Object getPropertyValue(Object component, int property) throws HibernateException { + Mapped m = (Mapped) component; + return (property == 0 ? m.getParameterizable() : m.getParameterMappings()); + } + + /** + * @see CompositeUserType#setPropertyValue(Object, int, Object) + */ + public void setPropertyValue(Object component, int property, Object value) throws HibernateException { + Mapped m = (Mapped) component; + if (property == 0) { + m.setParameterizable((Parameterizable)value); + } + else { + m.setParameterMappings((Map)value); + } + } + + /** + * @see CompositeUserType#deepCopy(Object) + */ + public Object deepCopy(Object value) throws HibernateException { + if (value == null) return null; + Mapped toCopy = (Mapped) value; + Mapped m = new Mapped(); + m.setParameterizable(toCopy.getParameterizable()); + m.setParameterMappings(new HashMap(toCopy.getParameterMappings())); + return m; + } + + /** + * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) + */ + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + String parameterizableUuid = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[0], session, owner); + if (StringUtils.isEmpty(parameterizableUuid)) { return null; } + String serializedMappings = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); + Definition d = DefinitionContext.getDefinitionByUuid(mappedType, parameterizableUuid); + Map mappings = new HashMap(); + if (StringUtils.isNotBlank(serializedMappings)) { + try { + mappings = Context.getSerializationService().deserialize(serializedMappings, Map.class, ReportingSerializer.class); + } + catch (Exception e) { + throw new HibernateException("Unable to deserialize parameter mappings for definition", e); + } + } + return new Mapped(d, mappings); + } + + /** + * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) + */ + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + String definitionUuid = null; + String serializedMappings = null; + if (value != null) { + Mapped m = (Mapped) value; + if (m.getParameterizable() != null) { + definitionUuid = m.getParameterizable().getUuid(); + if (m.getParameterMappings() != null && !m.getParameterMappings().isEmpty()) { + try { + serializedMappings = Context.getSerializationService().serialize(m.getParameterMappings(), ReportingSerializer.class); + } + catch (Exception e) { + throw new HibernateException("Unable to serialize mappings for definition", e); + } + } + } + } + HibernateUtil.standardType("STRING").nullSafeSet(st, definitionUuid, index, session); + HibernateUtil.standardType("STRING").nullSafeSet(st, serializedMappings, index+1, session); + } + + /** + * @see CompositeUserType#replace(Object, Object, SessionImplementor, Object) + */ + public Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return original; + } + + /** + * @see UserType#equals(Object, Object) + */ + public boolean equals(Object x, Object y) throws HibernateException { + return x != null && x.equals(y); + } + + /** + * @see UserType#hashCode(Object) + */ + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + /** + * @see CompositeUserType#disassemble(Object, SessionImplementor) + */ + public Serializable disassemble(Object value, SharedSessionContractImplementor session) throws HibernateException { + return (Serializable) deepCopy(value); + } + + /** + * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) + */ + public Object assemble(Serializable cached, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return deepCopy(cached); + } + + /** + * @see ParameterizedType#setParameterValues(Properties) + */ + public void setParameterValues(Properties parameters) { + String mappedTypeStr = parameters.getProperty("mappedType"); + try { + mappedType = (Class)Context.loadClass(mappedTypeStr); + } + catch (Exception e) { + throw new HibernateException("Error setting the mappedType property to " + mappedTypeStr, e); + } + } } \ No newline at end of file diff --git a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java similarity index 78% rename from api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java rename to api/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java index f83787d45f..55faf26a12 100644 --- a/api-1.9/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/PropertiesType.java @@ -1,146 +1,143 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import org.hibernate.HibernateException; -import org.hibernate.usertype.UserType; - -import java.io.IOException; -import java.io.Serializable; -import java.io.StringReader; -import java.io.StringWriter; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Map; -import java.util.Properties; - -import static java.sql.Types.VARCHAR; - -/** - * A report definition type - */ -public class PropertiesType implements UserType { - - /** - * @see UserType#assemble(Serializable, Object) - */ - public Object assemble(Serializable cached, Object owner) throws HibernateException { - if (cached == null) { - return null; - } - try { - String s = (String) cached; - Properties p = new Properties(); - p.load(new StringReader(s)); - return p; - } - catch (IOException e) { - throw new IllegalArgumentException("Unable to load properties from string", e); - } - } - - /** - * @see UserType#deepCopy(Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value != null) { - Properties val = (Properties) value; - Properties copy = new Properties(); - for ( Map.Entry e : val.entrySet() ) { - copy.setProperty((String) e.getKey(), (String) e.getValue()); - } - return copy; - } else { - return null; - } - } - - /** - * @see UserType#disassemble(Object) - */ - public Serializable disassemble(Object value) throws HibernateException { - if (value == null) { - return null; - } - try { - Properties props = (Properties) value; - StringWriter sw = new StringWriter(); - props.store(sw, null); - return sw.toString(); - } - catch (IOException e) { - throw new IllegalArgumentException("Unable to store properties as string", e); - } - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see UserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see UserType#nullSafeGet(ResultSet, String[], Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { - String s = rs.getString(names[0]); - return assemble(s, null); - } - - /** - * @see UserType#nullSafeSet(PreparedStatement, Object, int) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { - String val = (String) disassemble(value); - st.setString(index, val); - } - - /** - * @see UserType#replace(Object, Object, Object) - */ - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#returnedClass() - */ - @SuppressWarnings("unchecked") - public Class returnedClass() { - return Properties.class; - } - - /** - * @see UserType#sqlTypes() - */ - public int[] sqlTypes() { - return new int[] { VARCHAR }; - } -} +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.report.service.db; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; + +import java.io.IOException; +import java.io.Serializable; +import java.io.StringReader; +import java.io.StringWriter; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Map; +import java.util.Properties; + +import static java.sql.Types.VARCHAR; + +/** + * A report definition type + */ +public class PropertiesType implements UserType { + + /** + * @see UserType#assemble(Serializable, Object) + */ + public Object assemble(Serializable cached, Object owner) throws HibernateException { + if (cached == null) { + return null; + } + try { + String s = (String) cached; + Properties p = new Properties(); + p.load(new StringReader(s)); + return p; + } + catch (IOException e) { + throw new IllegalArgumentException("Unable to load properties from string", e); + } + } + + /** + * @see UserType#deepCopy(Object) + */ + public Object deepCopy(Object value) throws HibernateException { + if (value != null) { + Properties val = (Properties) value; + Properties copy = new Properties(); + for ( Map.Entry e : val.entrySet() ) { + copy.setProperty((String) e.getKey(), (String) e.getValue()); + } + return copy; + } else { + return null; + } + } + + /** + * @see UserType#disassemble(Object) + */ + public Serializable disassemble(Object value) throws HibernateException { + if (value == null) { + return null; + } + try { + Properties props = (Properties) value; + StringWriter sw = new StringWriter(); + props.store(sw, null); + return sw.toString(); + } + catch (IOException e) { + throw new IllegalArgumentException("Unable to store properties as string", e); + } + } + + /** + * @see UserType#equals(Object, Object) + */ + public boolean equals(Object x, Object y) throws HibernateException { + return x != null && x.equals(y); + } + + /** + * @see UserType#hashCode(Object) + */ + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + /** + * @see UserType#isMutable() + */ + public boolean isMutable() { + return true; + } + + /** + * @see UserType#nullSafeGet(ResultSet, String[], Object) + */ + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + String s = rs.getString(names[0]); + return assemble(s, null); + } + + /** + * @see UserType#nullSafeSet(PreparedStatement, Object, int) + */ + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + String val = (String) disassemble(value); + st.setString(index, val); + } + + /** + * @see UserType#replace(Object, Object, Object) + */ + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return original; + } + + /** + * @see UserType#returnedClass() + */ + @SuppressWarnings("unchecked") + public Class returnedClass() { + return Properties.class; + } + + /** + * @see UserType#sqlTypes() + */ + public int[] sqlTypes() { + return new int[] { VARCHAR }; + } +} diff --git a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java similarity index 73% rename from api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java rename to api/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java index 3c2cd5734a..bfce0700c1 100644 --- a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/RenderingModeType.java @@ -1,170 +1,167 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.type.Type; -import org.hibernate.usertype.CompositeUserType; -import org.hibernate.usertype.UserType; -import org.openmrs.module.reporting.common.HibernateUtil; -import org.openmrs.module.reporting.report.renderer.RenderingMode; -import org.openmrs.module.reporting.report.renderer.ReportRenderer; - -/** - * Custom User-Type for storing RenderingModes in a single table within 2 columns - * This type takes in 2 properties in the form: - *
- *   
- *     
- *     
- *   
- * 
- */ -@SuppressWarnings({"rawtypes"}) -public class RenderingModeType implements CompositeUserType { - - /** - * @see CompositeUserType#returnedClass() - */ - public Class returnedClass() { - return RenderingMode.class; - } - - /** - * @see CompositeUserType#getPropertyNames() - */ - public String[] getPropertyNames() { - return new String[] {"renderer", "argument"}; - } - - /** - * @see CompositeUserType#getPropertyTypes() - */ - public Type[] getPropertyTypes() { - return new Type[] { HibernateUtil.standardType("CLASS"), HibernateUtil.standardType("STRING") }; - } - - /** - * @see CompositeUserType#isMutable() - */ - public boolean isMutable() { - return true; - } - - /** - * @see CompositeUserType#getPropertyValue(java.lang.Object, int) - */ - public Object getPropertyValue(Object component, int property) throws HibernateException { - RenderingMode m = (RenderingMode) component; - return (property == 0 ? m.getRenderer().getClass() : m.getArgument()); - } - - /** - * @see CompositeUserType#setPropertyValue(java.lang.Object, int, java.lang.Object) - */ - public void setPropertyValue(Object component, int property, Object value) throws HibernateException { - RenderingMode m = (RenderingMode) component; - if (property == 0) { - ReportRenderer r = null; - if (value != null) { - try { - r = (ReportRenderer)((Class) value).newInstance(); - } - catch (Exception e) { - throw new HibernateException("Error instantiating a new reporting renderer from " + value, e); - } - } - m.setRenderer(r); - } - else { - m.setArgument((String)value); - } - } - - /** - * @see CompositeUserType#deepCopy(java.lang.Object) - */ - public Object deepCopy(Object value) throws HibernateException { - if (value == null) return null; - RenderingMode toCopy = (RenderingMode) value; - return new RenderingMode(toCopy.getRenderer(), toCopy.getLabel(), toCopy.getArgument(), toCopy.getSortWeight()); - } - - /** - * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - Class rendererClass = (Class) HibernateUtil.standardType("CLASS").nullSafeGet(rs, names[0], session, owner); - if (rendererClass == null) { return null; } - String argument = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); - ReportRenderer r = null; - try { - r = (ReportRenderer)((Class) rendererClass).newInstance(); - } - catch (Exception e) { - throw new HibernateException("Error instantiating a new reporting renderer from " + rendererClass, e); - } - return new RenderingMode(r, r.getClass().getSimpleName(), argument, null); - } - - /** - * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - RenderingMode mode = (RenderingMode) value; - HibernateUtil.standardType("CLASS").nullSafeSet(st, mode == null ? null : mode.getRenderer().getClass(), index, session); - HibernateUtil.standardType("STRING").nullSafeSet(st, mode == null ? null : mode.getArgument(), index+1, session); - } - - /** - * @see CompositeUserType#replace(java.lang.Object, java.lang.Object, org.hibernate.engine.SessionImplementor, java.lang.Object) - */ - public Object replace(Object original, Object target, SessionImplementor session, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see CompositeUserType#disassemble(Object, SessionImplementor) - */ - public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException { - return (Serializable) deepCopy(value); - } - - /** - * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) - */ - public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException { - return deepCopy(cached); - } +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.report.service.db; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.type.Type; +import org.hibernate.usertype.CompositeUserType; +import org.hibernate.usertype.UserType; +import org.openmrs.module.reporting.common.HibernateUtil; +import org.openmrs.module.reporting.report.renderer.RenderingMode; +import org.openmrs.module.reporting.report.renderer.ReportRenderer; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +/** + * Custom User-Type for storing RenderingModes in a single table within 2 columns + * This type takes in 2 properties in the form: + *
+ *   
+ *     
+ *     
+ *   
+ * 
+ */ +@SuppressWarnings({"rawtypes"}) +public class RenderingModeType implements CompositeUserType { + + /** + * @see CompositeUserType#returnedClass() + */ + public Class returnedClass() { + return RenderingMode.class; + } + + /** + * @see CompositeUserType#getPropertyNames() + */ + public String[] getPropertyNames() { + return new String[] {"renderer", "argument"}; + } + + /** + * @see CompositeUserType#getPropertyTypes() + */ + public Type[] getPropertyTypes() { + return new Type[] { HibernateUtil.standardType("CLASS"), HibernateUtil.standardType("STRING") }; + } + + /** + * @see CompositeUserType#isMutable() + */ + public boolean isMutable() { + return true; + } + + /** + * @see CompositeUserType#getPropertyValue(Object, int) + */ + public Object getPropertyValue(Object component, int property) throws HibernateException { + RenderingMode m = (RenderingMode) component; + return (property == 0 ? m.getRenderer().getClass() : m.getArgument()); + } + + /** + * @see CompositeUserType#setPropertyValue(Object, int, Object) + */ + public void setPropertyValue(Object component, int property, Object value) throws HibernateException { + RenderingMode m = (RenderingMode) component; + if (property == 0) { + ReportRenderer r = null; + if (value != null) { + try { + r = (ReportRenderer)((Class) value).newInstance(); + } + catch (Exception e) { + throw new HibernateException("Error instantiating a new reporting renderer from " + value, e); + } + } + m.setRenderer(r); + } + else { + m.setArgument((String)value); + } + } + + /** + * @see CompositeUserType#deepCopy(Object) + */ + public Object deepCopy(Object value) throws HibernateException { + if (value == null) return null; + RenderingMode toCopy = (RenderingMode) value; + return new RenderingMode(toCopy.getRenderer(), toCopy.getLabel(), toCopy.getArgument(), toCopy.getSortWeight()); + } + + /** + * @see CompositeUserType#nullSafeGet(ResultSet, String[], SessionImplementor, Object) + */ + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + Class rendererClass = (Class) HibernateUtil.standardType("CLASS").nullSafeGet(rs, names[0], session, owner); + if (rendererClass == null) { return null; } + String argument = (String) HibernateUtil.standardType("STRING").nullSafeGet(rs, names[1], session, owner); + ReportRenderer r = null; + try { + r = (ReportRenderer)((Class) rendererClass).newInstance(); + } + catch (Exception e) { + throw new HibernateException("Error instantiating a new reporting renderer from " + rendererClass, e); + } + return new RenderingMode(r, r.getClass().getSimpleName(), argument, null); + } + + /** + * @see CompositeUserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) + */ + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + RenderingMode mode = (RenderingMode) value; + HibernateUtil.standardType("CLASS").nullSafeSet(st, mode == null ? null : mode.getRenderer().getClass(), index, session); + HibernateUtil.standardType("STRING").nullSafeSet(st, mode == null ? null : mode.getArgument(), index+1, session); + } + + /** + * @see CompositeUserType#replace(Object, Object, org.hibernate.engine.SessionImplementor, Object) + */ + public Object replace(Object original, Object target, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return original; + } + + /** + * @see UserType#equals(Object, Object) + */ + public boolean equals(Object x, Object y) throws HibernateException { + return x != null && x.equals(y); + } + + /** + * @see UserType#hashCode(Object) + */ + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + /** + * @see CompositeUserType#disassemble(Object, SessionImplementor) + */ + public Serializable disassemble(Object value, SharedSessionContractImplementor session) throws HibernateException { + return (Serializable) deepCopy(value); + } + + /** + * @see CompositeUserType#assemble(Serializable, SessionImplementor, Object) + */ + public Object assemble(Serializable cached, SharedSessionContractImplementor session, Object owner) throws HibernateException { + return deepCopy(cached); + } } \ No newline at end of file diff --git a/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDAO.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDAO.java index b6c728803f..142b464831 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDAO.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDAO.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.service.db; @@ -121,11 +117,18 @@ public List getReportDesigns(ReportDefinition reportDefinition, Cl * @return the {@link ReportRequest} with the passed uuid */ public ReportRequest getReportRequestByUuid(String uuid); - + + /** + * @return all {@link ReportRequest} in the system that match the passed parameters + * @see org.openmrs.module.reporting.report.service.ReportService#getReportRequests(ReportDefinition, Date, Date, Integer, Integer, Status...) + */ + public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer firstResult, Integer maxResults, Status...statuses); + /** * @return all {@link ReportRequest} in the system that match the passed parameters + * @see org.openmrs.module.reporting.report.service.ReportService#getReportRequestsCount(ReportDefinition, Date, Date, Status...) */ - public List getReportRequests(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Integer mostRecentNum, Status...statuses); + public long getReportRequestsCount(ReportDefinition reportDefinition, Date requestOnOrAfter, Date requestOnOrBefore, Status...statuses); /** * Deletes the passed {@link ReportRequest} diff --git a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java b/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java similarity index 75% rename from api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java rename to api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java index 4e0a4d02d9..4caeb1dca3 100644 --- a/api-2.0/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/service/db/ReportDefinitionType.java @@ -1,123 +1,120 @@ -/** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org - * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. - */ -package org.openmrs.module.reporting.report.service.db; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Types; - -import org.hibernate.HibernateException; -import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.usertype.UserType; -import org.openmrs.api.context.Context; -import org.openmrs.module.reporting.report.definition.ReportDefinition; -import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; - -/** - * A report definition type - */ -public class ReportDefinitionType implements UserType { - - /** - * @see UserType#assemble(Serializable, Object) - */ - public Object assemble(Serializable cached, Object owner) throws HibernateException { - if(cached == null){ - return null; - } - return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(cached.toString()); - } - - /** - * @see UserType#deepCopy(Object) - */ - public Object deepCopy(Object value) throws HibernateException { - return value; - } - - /** - * @see UserType#disassemble(Object) - */ - public Serializable disassemble(Object value) throws HibernateException { - if (value == null) { - return null; - } - return ((ReportDefinition)value).getUuid(); - } - - /** - * @see UserType#equals(Object, Object) - */ - public boolean equals(Object x, Object y) throws HibernateException { - return x != null && x.equals(y); - } - - /** - * @see UserType#hashCode(Object) - */ - public int hashCode(Object x) throws HibernateException { - return x.hashCode(); - } - - /** - * @see UserType#isMutable() - */ - public boolean isMutable() { - return false; - } - - /** - * @see UserType#nullSafeGet(ResultSet, String[], Object) - */ - public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException { - String uuid = rs.getString(names[0]); - if (uuid == null) { - return null; - } - return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(uuid); - } - - /** - * @see UserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) - */ - public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException { - ReportDefinition d = (ReportDefinition) value; - String val = (d == null ? null : d.getUuid()); - st.setString(index, val); - } - - /** - * @see UserType#replace(Object, Object, Object) - */ - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return original; - } - - /** - * @see UserType#returnedClass() - */ - @SuppressWarnings("rawtypes") - public Class returnedClass() { - return ReportDefinition.class; - } - - /** - * @see UserType#sqlTypes() - */ - public int[] sqlTypes() { - return new int[] { Types.VARCHAR }; - } -} +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.report.service.db; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SessionImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.report.definition.ReportDefinition; +import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; + +import java.io.Serializable; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; + +/** + * A report definition type + */ +public class ReportDefinitionType implements UserType { + + /** + * @see UserType#assemble(Serializable, Object) + */ + public Object assemble(Serializable cached, Object owner) throws HibernateException { + if(cached == null){ + return null; + } + return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(cached.toString()); + } + + /** + * @see UserType#deepCopy(Object) + */ + public Object deepCopy(Object value) throws HibernateException { + return value; + } + + /** + * @see UserType#disassemble(Object) + */ + public Serializable disassemble(Object value) throws HibernateException { + if (value == null) { + return null; + } + return ((ReportDefinition)value).getUuid(); + } + + /** + * @see UserType#equals(Object, Object) + */ + public boolean equals(Object x, Object y) throws HibernateException { + return x != null && x.equals(y); + } + + /** + * @see UserType#hashCode(Object) + */ + public int hashCode(Object x) throws HibernateException { + return x.hashCode(); + } + + /** + * @see UserType#isMutable() + */ + public boolean isMutable() { + return false; + } + + /** + * @see UserType#nullSafeGet(ResultSet, String[], Object) + */ + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException { + String uuid = rs.getString(names[0]); + if (uuid == null) { + return null; + } + return Context.getService(ReportDefinitionService.class).getDefinitionByUuid(uuid); + } + + /** + * @see UserType#nullSafeSet(PreparedStatement, Object, int, SessionImplementor) + */ + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { + ReportDefinition d = (ReportDefinition) value; + String val = (d == null ? null : d.getUuid()); + st.setString(index, val); + } + + /** + * @see UserType#replace(Object, Object, Object) + */ + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return original; + } + + /** + * @see UserType#returnedClass() + */ + @SuppressWarnings("rawtypes") + public Class returnedClass() { + return ReportDefinition.class; + } + + /** + * @see UserType#sqlTypes() + */ + public int[] sqlTypes() { + return new int[] { Types.VARCHAR }; + } +} diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/DeleteOldReportsTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/DeleteOldReportsTask.java index 1edec9d9f6..50b83995ef 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/DeleteOldReportsTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/DeleteOldReportsTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/PersistCachedReportsTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/PersistCachedReportsTask.java index 19bc3da806..42d65fe10f 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/PersistCachedReportsTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/PersistCachedReportsTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; /** diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/QueueScheduledReportsTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/QueueScheduledReportsTask.java index fb6f9422ec..5fb228da34 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/QueueScheduledReportsTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/QueueScheduledReportsTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTask.java index a47e230173..844caadb92 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTimerTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTimerTask.java index e7c6802895..2750e8018d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTimerTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/ReportingTimerTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/task/RunQueuedReportsTask.java b/api/src/main/java/org/openmrs/module/reporting/report/task/RunQueuedReportsTask.java index 22e659ea31..beae157ef1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/task/RunQueuedReportsTask.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/task/RunQueuedReportsTask.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.task; import org.apache.commons.logging.Log; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/util/PeriodIndicatorReportUtil.java b/api/src/main/java/org/openmrs/module/reporting/report/util/PeriodIndicatorReportUtil.java index 4735d986eb..3c3bb838b1 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/util/PeriodIndicatorReportUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/util/PeriodIndicatorReportUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.util; import java.util.ArrayList; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/util/ReportUtil.java b/api/src/main/java/org/openmrs/module/reporting/report/util/ReportUtil.java index ab2fdecda7..64658110c7 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/util/ReportUtil.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/util/ReportUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.util; import org.apache.commons.io.FileUtils; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/util/SqlScriptParser.java b/api/src/main/java/org/openmrs/module/reporting/report/util/SqlScriptParser.java index f93492f193..d2a6e6a1ed 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/util/SqlScriptParser.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/util/SqlScriptParser.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.report.util; import java.io.BufferedReader; diff --git a/api/src/main/java/org/openmrs/module/reporting/report/util/SqlUtils.java b/api/src/main/java/org/openmrs/module/reporting/report/util/SqlUtils.java index 4f9797790f..70ce5b390e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/report/util/SqlUtils.java +++ b/api/src/main/java/org/openmrs/module/reporting/report/util/SqlUtils.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.report.util; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/CalculationRegistrationShortConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/CalculationRegistrationShortConverter.java index c71ec4abc5..b65b4ba0f9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/CalculationRegistrationShortConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/CalculationRegistrationShortConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import com.thoughtworks.xstream.converters.ConverterLookup; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/CohortDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/CohortDefinitionConverter.java index 4b24646305..c308791074 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/CohortDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/CohortDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/DataSetDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/DataSetDefinitionConverter.java index 2fd6eaf468..01d60c024e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/DataSetDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/DataSetDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/DimensionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/DimensionConverter.java index 636c60d88b..b51c4e78ec 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/DimensionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/DimensionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterDataDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterDataDefinitionConverter.java index 970831fe11..1c07944c24 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterDataDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterDataDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterQueryConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterQueryConverter.java index 7363bcf8ba..b0cbb7cf28 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterQueryConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/EncounterQueryConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/IndicatorConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/IndicatorConverter.java index ead23cd58f..ce21713d10 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/IndicatorConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/IndicatorConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ObsQueryConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ObsQueryConverter.java index af287ed7e4..3cbd9416ff 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/ObsQueryConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ObsQueryConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/PatientDataDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/PatientDataDefinitionConverter.java index ed81e2b3b6..669cac9d2d 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/PatientDataDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/PatientDataDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/PersonDataDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/PersonDataDefinitionConverter.java index 2ccdc5a6e9..3a14e5b452 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/PersonDataDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/PersonDataDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/PersonQueryConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/PersonQueryConverter.java index 96e2580c6d..931ddfe08b 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/PersonQueryConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/PersonQueryConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportDefinitionConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportDefinitionConverter.java index 912b81d678..0b83e99440 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportDefinitionConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportDefinitionConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.api.context.Context; diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java index 76fc81eeff..c356f07150 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingSerializer.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import com.thoughtworks.xstream.XStream; @@ -8,21 +17,34 @@ import com.thoughtworks.xstream.io.xml.DomDriver; import com.thoughtworks.xstream.mapper.Mapper; import com.thoughtworks.xstream.mapper.MapperWrapper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.cohort.definition.CohortDefinition; +import org.openmrs.module.reporting.dataset.definition.CohortIndicatorAndDimensionDataSetDefinition; +import org.openmrs.module.reporting.evaluation.parameter.Mapped; +import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.module.reporting.report.definition.ReportDefinition; import org.openmrs.module.serialization.xstream.XStreamShortSerializer; import org.openmrs.module.serialization.xstream.mapper.CGLibMapper; import org.openmrs.module.serialization.xstream.mapper.HibernateCollectionMapper; import org.openmrs.module.serialization.xstream.mapper.JavassistMapper; import org.openmrs.module.serialization.xstream.mapper.NullValueMapper; import org.openmrs.serialization.SerializationException; +import org.openmrs.serialization.SimpleXStreamSerializer; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; - +import java.lang.reflect.Method; public class ReportingSerializer extends XStreamShortSerializer { private static ThreadLocal cache = new ThreadLocal(); + + private final Log log = LogFactory.getLog(this.getClass()); + + private boolean xstreamSecuritySetup = false; /** * @throws SerializationException @@ -71,10 +93,15 @@ public Object unmarshal(HierarchicalStreamReader reader, Object root) { xstream.registerConverter(new IndicatorConverter(mapper, converterLookup)); xstream.registerConverter(new ReportDefinitionConverter(mapper, converterLookup)); + xstream.allowTypes(new Class[] {Parameter.class, Mapped.class, CohortIndicatorAndDimensionDataSetDefinition.CohortIndicatorAndDimensionSpecification.class}); } @Override synchronized public T deserialize(String serializedObject, Class clazz) throws SerializationException { + if (!xstreamSecuritySetup) { + setupXStreamSecurity(); + xstreamSecuritySetup = true; + } boolean cacheOwner = cache.get() == null; if (cacheOwner) { cache.set(new MapBackedDataHolder()); @@ -102,4 +129,31 @@ public void serializeToStream(Object object, OutputStream out) { } } + /** + * Sets up xstream security on the Reporting Serializer to match the OpenMRS core security configuration + */ + public void setupXStreamSecurity() throws SerializationException { + log.debug("Setting up xstream security on ReportingSerializer"); + SimpleXStreamSerializer serializer = null; + try { + serializer = Context.getRegisteredComponent("simpleXStreamSerializer", SimpleXStreamSerializer.class); + } + catch (Exception ignored) { + } + if (serializer == null) { + log.debug("Not setting up XStream security as no simpleXStreamSerializer component is found"); + return; + } + try { + Method method = serializer.getClass().getMethod("initXStream", XStream.class); + method.invoke(serializer, xstream); + log.info("XStream security initialized on ReportingSerializer"); + } + catch (NoSuchMethodException ignored) { + log.debug("Not setting up XStream Security as no initXStream method found on SimpleXStreamSerializer"); + } + catch (Exception e) { + throw new SerializationException("Failed to set up XStream Security on Reporting Serializer", e); + } + } } diff --git a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingShortConverter.java b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingShortConverter.java index c642303ae1..84f7312f65 100644 --- a/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingShortConverter.java +++ b/api/src/main/java/org/openmrs/module/reporting/serializer/ReportingShortConverter.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.serializer; import org.openmrs.module.reporting.definition.service.DefinitionService; diff --git a/api/src/main/java/org/openmrs/module/reporting/template/HandlebarsHelpers.java b/api/src/main/java/org/openmrs/module/reporting/template/HandlebarsHelpers.java index b26bb9c107..18b4ba40d9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/template/HandlebarsHelpers.java +++ b/api/src/main/java/org/openmrs/module/reporting/template/HandlebarsHelpers.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.template; import com.github.jknack.handlebars.Handlebars; diff --git a/api/src/main/java/org/openmrs/module/reporting/template/TemplateFactory.java b/api/src/main/java/org/openmrs/module/reporting/template/TemplateFactory.java index 205f394306..31f28cafc9 100644 --- a/api/src/main/java/org/openmrs/module/reporting/template/TemplateFactory.java +++ b/api/src/main/java/org/openmrs/module/reporting/template/TemplateFactory.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.template; import com.github.jknack.handlebars.Handlebars; diff --git a/api/src/main/java/org/openmrs/module/reporting/validator/CohortDefinitionValidator.java b/api/src/main/java/org/openmrs/module/reporting/validator/CohortDefinitionValidator.java index 5bf643f012..9e2871ef27 100644 --- a/api/src/main/java/org/openmrs/module/reporting/validator/CohortDefinitionValidator.java +++ b/api/src/main/java/org/openmrs/module/reporting/validator/CohortDefinitionValidator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.validator; import java.util.Collection; diff --git a/api/src/main/java/org/openmrs/module/reporting/web/renderers/AbstractWebReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/web/renderers/AbstractWebReportRenderer.java index f480388bdc..0fe48f4540 100644 --- a/api/src/main/java/org/openmrs/module/reporting/web/renderers/AbstractWebReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/web/renderers/AbstractWebReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.renderers; diff --git a/api/src/main/java/org/openmrs/module/reporting/web/renderers/DefaultWebRenderer.java b/api/src/main/java/org/openmrs/module/reporting/web/renderers/DefaultWebRenderer.java index fcfa81c41e..2c735bbb12 100644 --- a/api/src/main/java/org/openmrs/module/reporting/web/renderers/DefaultWebRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/web/renderers/DefaultWebRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.renderers; diff --git a/api/src/main/java/org/openmrs/module/reporting/web/renderers/LogicReportWebRenderer.java b/api/src/main/java/org/openmrs/module/reporting/web/renderers/LogicReportWebRenderer.java index ea3b1e6e11..079046af6e 100644 --- a/api/src/main/java/org/openmrs/module/reporting/web/renderers/LogicReportWebRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/web/renderers/LogicReportWebRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.renderers; diff --git a/api/src/main/java/org/openmrs/module/reporting/web/renderers/WebReportRenderer.java b/api/src/main/java/org/openmrs/module/reporting/web/renderers/WebReportRenderer.java index 057343e276..14688b2982 100644 --- a/api/src/main/java/org/openmrs/module/reporting/web/renderers/WebReportRenderer.java +++ b/api/src/main/java/org/openmrs/module/reporting/web/renderers/WebReportRenderer.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.renderers; diff --git a/api/src/main/resources/ReportDesign.hbm.xml b/api/src/main/resources/ReportDesign.hbm.xml index b9a28bbe99..686c0d5fca 100644 --- a/api/src/main/resources/ReportDesign.hbm.xml +++ b/api/src/main/resources/ReportDesign.hbm.xml @@ -4,13 +4,17 @@ - + + + reporting_report_design_id_seq + + - + @@ -18,19 +22,23 @@ - + - + - + - + + + reporting_report_design_resource_id_seq + + @@ -41,15 +49,19 @@ - + - + - + - + + + reporting_report_processor_id_seq + + @@ -67,11 +79,11 @@ - + - + - + diff --git a/api/src/main/resources/ReportRequest.hbm.xml b/api/src/main/resources/ReportRequest.hbm.xml index 468af9cec7..7a78c49134 100644 --- a/api/src/main/resources/ReportRequest.hbm.xml +++ b/api/src/main/resources/ReportRequest.hbm.xml @@ -5,7 +5,11 @@ - + + + reporting_report_request_id_seq + + diff --git a/api/src/main/resources/liquibase.xml b/api/src/main/resources/liquibase.xml index bc83844e71..75b128df0d 100644 --- a/api/src/main/resources/liquibase.xml +++ b/api/src/main/resources/liquibase.xml @@ -56,7 +56,8 @@ - + + 8:53ee2581fae69de6011402f9ccf56cdd @@ -72,19 +73,43 @@ - + + + + + + + + + + + UPDATE reporting_report_design rd + SET report_definition_uuid = so.uuid + FROM serialized_object so + WHERE rd.report_definition_id = so.serialized_object_id; + + + + + 8:376812e41a0a69544e5d3a03f3a99c7f alter table reporting_report_design modify report_definition_uuid char(38) not null; + + + alter table reporting_report_design alter column report_definition_uuid type char(38); + + + 3:bddba97d81d6daa7fd6fbb478897fd84 3:e557ea83775089ed9e636768b25de9a0 - + SELECT count(*) FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE KCU @@ -95,7 +120,7 @@ - + @@ -237,6 +262,8 @@ + 3:8e88f53150534221e9c32cd0e2c94706 + 3:f821b2d05cdaf6593e2c6a48907b5d48 @@ -244,7 +271,7 @@ Add processAutomatically boolean to ReportRequest - + @@ -267,6 +294,9 @@ 3:bc9b147af791381ff5a98a7786f7d638 3:779193b8124f3299601ca74ff7699dfe + + 3:779193b8124f3299601ca74ff7699dfe + 3:357a305d1d6f3723032301f9e96e6f22 @@ -288,10 +318,10 @@ - + - + @@ -356,6 +386,10 @@ + 8:29d9c10336ca467e93b34db77a250d12 + 8:631a987732036d592c48c118f8de368d + 3:f6ea0df533cc324ea0d6275d72980c78 + 3:e868cc03288964204097d0beef162f5f Remove OpenMRS scheduled tasks produced by the reporting module @@ -364,7 +398,7 @@ where task_config_id in (select task_config_id from scheduler_task_config where schedulable_class like 'org.openmrs.module.reporting.%'); - delete from `scheduler_task_config` where schedulable_class like 'org.openmrs.module.reporting.%'; + delete from scheduler_task_config where schedulable_class like 'org.openmrs.module.reporting.%'; @@ -590,5 +624,18 @@ - - \ No newline at end of file + + + + + + + Update data type of content_type column from reporting_report_design_resource table + + + + + diff --git a/api/src/main/resources/messages.properties b/api/src/main/resources/messages.properties index d17c4c00e9..66e46db39a 100644 --- a/api/src/main/resources/messages.properties +++ b/api/src/main/resources/messages.properties @@ -519,8 +519,13 @@ reporting.ScriptedCompositionPatientDataDefinition=Composition #--------- DATA SET DEFINITION LOCALIZATION ---------- +reporting.button.save=Save +reporting.button.close=Close +reporting.button.preview=Preview reporting.DataExportDataSetDefinition=Data Export Dataset reporting.SqlDataSetDefinition=SQL Dataset +reporting.IterableSqlDataSetDefinition.saved=Saved Iterable SQL Dataset Definition +reporting.IterableSqlDataSetDefinition=Iterable SQL Dataset reporting.SqlDataSetDefinition.saved=Saved SQL Dataset Definition reporting.CohortCrossTabDataSetDefinition=Cohort Crosstab Dataset reporting.CohortIndicatorDataSetDefinition=Period Indicator Report Dataset @@ -727,6 +732,7 @@ reporting.sqlQuery=SQL Query reporting.csv=CSV reporting.tsv=TSV reporting.xml=XML +reporting.excel=Excel reporting.add=ADD reporting.dimension=Dimension reporting.dimensions=Dimensions @@ -762,4 +768,8 @@ reporting.chooseBaseDef=Choose base definition reporting.noIterationsYet=No Iterations added yet reporting.addIteration=[+] Add Iteration reporting.createNewLogicDataSet=Create New Logic DataSet -reporting.previewLimitedToRandomCohort=Results have been limited to a random cohort of {0} patients \ No newline at end of file +reporting.previewLimitedToRandomCohort=Results have been limited to a random cohort of {0} patients +reporting.affectedReportDefinitions.label=Affected Reports Definitions +reporting.loadAffectedReportDefinitions.label=Load Affected Report Definitions +reporting.noAffectedReportDefs.label=No Affected Report Defifnitions! +reporting.logicModuleNotStarted.error=Logic module is not started. Please Ensure Logic Module is Installed and Running diff --git a/api/src/main/resources/messages_fr.properties b/api/src/main/resources/messages_fr.properties index 837e79061d..e9ff31f773 100755 --- a/api/src/main/resources/messages_fr.properties +++ b/api/src/main/resources/messages_fr.properties @@ -64,4 +64,5 @@ reporting.reportHistory.status=État reporting.reportHistory.report=Rapport reporting.reportHistory.open=Ouvrir - +reporting.parameter.startDate=Date de début +reporting.parameter.endDate=Date d'arrêt \ No newline at end of file diff --git a/api/src/main/resources/moduleApplicationContext.xml b/api/src/main/resources/moduleApplicationContext.xml index 38a380a90d..2213b24170 100644 --- a/api/src/main/resources/moduleApplicationContext.xml +++ b/api/src/main/resources/moduleApplicationContext.xml @@ -41,7 +41,7 @@ - + diff --git a/bamboo-specs/bamboo.yml b/bamboo-specs/bamboo.yml new file mode 100644 index 0000000000..351bf4d3e9 --- /dev/null +++ b/bamboo-specs/bamboo.yml @@ -0,0 +1,250 @@ +--- +version: 2 +plan: + project-key: REP + key: REP + name: Reporting Module + description: More details of the release in https://wiki.openmrs.org/x/i4DTAw +stages: +- Build and Test: + manual: false + final: false + jobs: + - Build and Test JDK 8 + - Build and Test JDK 17 + - Build and Test JDK 11 + - Build and Test JDK 24 + - Build and Test JDK 21 +- Deploy: + manual: false + final: false + jobs: + - Deploy to Maven +- Release: + manual: true + final: false + jobs: + - Release to Maven +Build and Test JDK 8: + key: BTJ8 + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" maven:3.9.9-amazoncorretto-8 bash -c 'mvn clean package && chmod -R 777 .' + description: Build and test + artifact-subscriptions: [] +Build and Test JDK 17: + key: BTJ17 + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" maven:3.9.9-amazoncorretto-17 bash -c 'mvn clean package && chmod -R 777 .' + description: Build and test + artifact-subscriptions: [] +Build and Test JDK 11: + key: BTJ11 + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" maven:3.9.9-amazoncorretto-11 bash -c 'mvn clean package && chmod -R 777 .' + description: Build and test + artifact-subscriptions: [] +Build and Test JDK 24: + key: BTJ24 + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" maven:3.9.9-amazoncorretto-24 bash -c 'mvn clean package && chmod -R 777 .' + description: Build and test + artifact-subscriptions: [] +Build and Test JDK 21: + key: BTJ21 + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" maven:3.9.9-amazoncorretto-21 bash -c 'mvn clean package && chmod -R 777 .' + description: Build and test + artifact-subscriptions: [] +Deploy to Maven: + key: DTM + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout default repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker pull ${bamboo.build.docker.image.id} + + docker run -v m2-repo:/root/.m2/repository -v ~/.m2/settings.xml:/.m2/settings.xml:ro -v ${PWD}:/module --rm -w="/module" ${bamboo.build.docker.image.id} bash -c 'mvn deploy -DskipTests --settings /.m2/settings.xml' + description: Deploy + artifact-subscriptions: [] +Release to Maven: + key: RTMVN + tasks: + - checkout: + force-clean-build: 'false' + description: Checkout Default Repository + - checkout: + repository: Release scripts + path: release-scripts + force-clean-build: 'false' + description: Checkout Release Scripts Repository + - script: + interpreter: SHELL + scripts: + - |- + #!/bin/bash -eu + + set -x + + docker pull ${bamboo.build.docker.image.id} + + docker run \ + -v m2-repo:/root/.m2/repository \ + -v ~/.m2/settings.xml:/root/.m2/settings.xml:ro \ + -v ${PWD}:/module \ + -v ~/.ssh/github:/root/.ssh:ro \ + -e GIT_USER_NAME=$GIT_USER_NAME \ + -e GIT_USER_EMAIL=$GIT_USER_EMAIL \ + -e GIT_SSH_COMMAND='ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' \ + --rm \ + -w='/module' \ + ${bamboo.build.docker.image.id} \ + bash -c ' + yum -y install git && + yum clean all && + git config --global user.email "$GIT_USER_EMAIL" && + git config --global user.name "$GIT_USER_NAME" && + git config --global --add safe.directory /module && + ./release-scripts/release-prepare-perform.sh \ + -r ${bamboo.maven.release.version} \ + -d ${bamboo.maven.development.version} \ + -e ${bamboo.planRepository.repositoryUrl} + ' + environment: GIT_USER_NAME=${bamboo.git.user.name} GIT_USER_EMAIL=${bamboo.git.user.email} + description: Release prepare perform + - any-task: + plugin-key: com.atlassian.bamboo.plugins.variable.updater.variable-updater-generic:variable-extractor + configuration: + variable: maven.release.version + removeSnapshot: 'true' + variableScope: PLAN + description: Save next release version + - any-task: + plugin-key: com.atlassian.bamboo.plugins.variable.updater.variable-updater-generic:variable-extractor + configuration: + variable: maven.development.version + variableScope: JOB + description: Retrieve next snaphot version + artifact-subscriptions: [] +variables: + build.docker.image.id: maven:3.9.9-amazoncorretto-21 + maven.development.version: '2.0.0-SNAPSHOT' + maven.release.version: 1.29.0 + refapp.distro.property: reportingVersion +repositories: +- Git: + type: git + description: A Git Repository + url: https://github.com/openmrs/openmrs-module-reporting.git + branch: master + command-timeout-minutes: '180' + lfs: 'false' + verbose-logs: 'false' + use-shallow-clones: 'true' + cache-on-agents: 'false' + submodules: 'false' + ssh-key-applies-to-submodules: 'false' + fetch-all: 'false' +- Release scripts: + scope: global +triggers: +- polling: + period: '180' + repositories: + - Git +branches: + create: manually + delete: never + link-to-jira: true +notifications: +- events: + - job-failed + recipients: + - committers + - emails: + - dev-refapp@openmrs.org +labels: +- refapp +dependencies: + require-all-stages-passing: false + enabled-for-branches: true + block-strategy: block_if_parent_has_changes + plans: + - REFAPP-OMODDISTRO + - EMRAPI-EMRAPI + - REPREST-REPREST + - REPUI-REPUI +other: + concurrent-build-plugin: system-default +--- +version: 2 +plan: + key: REP-REP +plan-permissions: +- roles: + - anonymous + permissions: + - view +... diff --git a/license-header.txt b/license-header.txt new file mode 100644 index 0000000000..1b0eb4fefd --- /dev/null +++ b/license-header.txt @@ -0,0 +1,7 @@ +This Source Code Form is subject to the terms of the Mozilla Public License, +v. 2.0. If a copy of the MPL was not distributed with this file, You can +obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under +the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + +Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS +graphic logo is a trademark of OpenMRS Inc. \ No newline at end of file diff --git a/omod/pom.xml b/omod/pom.xml index 0023c8f6ac..bcc520947e 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -3,7 +3,7 @@ org.openmrs.module reporting - 1.16.0-SNAPSHOT + 2.2.0-SNAPSHOT reporting-omod jar @@ -16,16 +16,6 @@ ${project.parent.artifactId}-api ${project.parent.version} - - ${project.parent.groupId} - ${project.parent.artifactId}-api-1.9 - ${project.parent.version} - - - ${project.parent.groupId} - ${project.parent.artifactId}-api-2.0 - ${project.parent.version} - org.openmrs.module legacyui-omod diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/CompositionCohortDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/CompositionCohortDefinitionController.java index 1334633453..5dc387a09b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/CompositionCohortDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/CompositionCohortDefinitionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.cohorts; import org.openmrs.api.context.Context; @@ -14,7 +23,7 @@ @Controller public class CompositionCohortDefinitionController { - @RequestMapping("/module/reporting/cohorts/compositionCohortDefinition") + @RequestMapping("/module/reporting/cohorts/compositionCohortDefinition.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid, @RequestParam(value="copyFromUuid", required=false) String copyFromUuid) { @@ -31,7 +40,7 @@ public void showForm(ModelMap model, } } - @RequestMapping("/module/reporting/cohorts/compositionCohortDefinitionSetComposition") + @RequestMapping("/module/reporting/cohorts/compositionCohortDefinitionSetComposition.form") public String setComposition(@RequestParam("uuid") String uuid, @RequestParam("compositionString") String compositionString) { CohortDefinition def = Context.getService(CohortDefinitionService.class).getDefinitionByUuid(uuid); @@ -48,7 +57,7 @@ public String setComposition(@RequestParam("uuid") String uuid, * @param uuid * @return */ - @RequestMapping("/module/reporting/cohorts/compositionCohortDefinitionClone") + @RequestMapping("/module/reporting/cohorts/compositionCohortDefinitionClone.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value="description", required=false) String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/ManageCohortDefinitionsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/ManageCohortDefinitionsController.java index e46ea37989..98b05d9c57 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/ManageCohortDefinitionsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/ManageCohortDefinitionsController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.cohorts; import java.util.ArrayList; @@ -45,7 +54,7 @@ public CohortDefinition getCohortDefinition(@RequestParam(required = false, valu /** * Basically acts as the formBackingObject() method for saving a CohortDefinition. */ - @RequestMapping("/module/reporting/cohorts/editCohortDefinition") + @RequestMapping("/module/reporting/cohorts/editCohortDefinition.form") public String editCohortDefinition(ModelMap model, @ModelAttribute("cohortDefinition") CohortDefinition cohortDefinition) { addPropertiesToModel(model, cohortDefinition); return "/module/reporting/cohorts/cohortDefinitionEditor"; @@ -54,7 +63,7 @@ public String editCohortDefinition(ModelMap model, @ModelAttribute("cohortDefini /** * Saves a cohort definition. */ - @RequestMapping("/module/reporting/cohorts/saveCohortDefinition") + @RequestMapping("/module/reporting/cohorts/saveCohortDefinition.form") @SuppressWarnings("unchecked") public String saveCohortDefinition(@ModelAttribute("cohortDefinition") CohortDefinition cohortDefinition, BindingResult bindingResult, ModelMap model, HttpServletRequest request) { @@ -123,7 +132,7 @@ public String saveCohortDefinition(@ModelAttribute("cohortDefinition") CohortDef * @return * @throws EvaluationException */ - @RequestMapping("/module/reporting/cohorts/evaluateCohortDefinition") + @RequestMapping("/module/reporting/cohorts/evaluateCohortDefinition.form") public String evaluateCohortDefinition(@RequestParam(required = false, value = "uuid") String uuid, @RequestParam(required = false, value = "type") Class type, ModelMap model) throws EvaluationException { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/SqlCohortDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/SqlCohortDefinitionController.java index 000da621d8..b55b15dda8 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/SqlCohortDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/cohorts/SqlCohortDefinitionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.cohorts; import java.util.List; @@ -20,7 +29,7 @@ @Controller public class SqlCohortDefinitionController { - @RequestMapping("/module/reporting/cohorts/sqlCohortDefinition") + @RequestMapping("/module/reporting/cohorts/sqlCohortDefinition.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid, @RequestParam(value="copyFromUuid", required=false) String copyFromUuid) { @@ -38,7 +47,7 @@ public void showForm(ModelMap model, } } - @RequestMapping("/module/reporting/cohorts/sqlCohortDefinitionAssignQueryString") + @RequestMapping("/module/reporting/cohorts/sqlCohortDefinitionAssignQueryString.form") public String saveQueryString( HttpSession httpSession, WebRequest webRequest, @@ -67,7 +76,7 @@ public String saveQueryString( * Copies the SQL cohort definition with the given uuid into another one with the same * parameters and searches, but blank name/description and SQL string */ - @RequestMapping("/module/reporting/cohorts/sqlCohortDefinitionClone") + @RequestMapping("/module/reporting/cohorts/sqlCohortDefinitionClone.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value="description", required=false) String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/AjaxController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/AjaxController.java index a06b642846..e623ae52cb 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/AjaxController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/AjaxController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import java.util.Iterator; @@ -18,7 +27,7 @@ @Controller public class AjaxController { - @RequestMapping("/module/reporting/ajax/getRenderingModes") + @RequestMapping("/module/reporting/ajax/getRenderingModes.form") public String getRenderingModes(Model model, @RequestParam("reportDefinitionUuid") String reportUuid, @RequestParam(value="includeInteractiveRenderers", required=false) Boolean includeInteractive, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/DashboardController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/DashboardController.java index fb45f00572..e78957dcf5 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/DashboardController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/DashboardController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.springframework.stereotype.Controller; @@ -10,7 +19,7 @@ @Controller public class DashboardController { - @RequestMapping("/module/reporting/dashboard/index") + @RequestMapping("/module/reporting/dashboard/index.form") public void showDashboard() { } diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/EditAnnotatedDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/EditAnnotatedDefinitionController.java index 63f0da7a47..46d485bd29 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/EditAnnotatedDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/EditAnnotatedDefinitionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import java.util.ArrayList; @@ -52,7 +61,7 @@ public Definition getDefinition(@RequestParam(required = false, value = "uuid") /** * Basically acts as the formBackingObject() method for saving a CohortDefinition. */ - @RequestMapping("/module/reporting/definition/editAnnotatedDefinition") + @RequestMapping("/module/reporting/definition/editAnnotatedDefinition.form") public String editAnnotatedDefinition(ModelMap model, @RequestParam(required = true, value = "parentType") Class parentType, @ModelAttribute("definition") Definition definition) { @@ -64,7 +73,7 @@ public String editAnnotatedDefinition(ModelMap model, /** * Saves a cohort definition. */ - @RequestMapping("/module/reporting/definition/saveAnnotatedDefinition") + @RequestMapping("/module/reporting/definition/saveAnnotatedDefinition.form") @SuppressWarnings({"unchecked", "rawtypes"}) public String saveAnnotatedDefinition(@RequestParam(required = true, value = "parentType") Class parentType, @ModelAttribute("definition") Definition definition, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/GetMappedAsStringController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/GetMappedAsStringController.java index fe5efa83ed..0c8876d271 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/GetMappedAsStringController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/GetMappedAsStringController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import java.util.*; @@ -27,7 +36,7 @@ public class GetMappedAsStringController { private static Log log = LogFactory.getLog(GetMappedAsStringController.class); - @RequestMapping("/module/reporting/widget/getMappedAsString") + @RequestMapping("/module/reporting/widget/getMappedAsString.form") public void getMappedAsString(Model model, HttpServletRequest request, @RequestParam("valueType") String valueTypeClassnames, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/InvalidSerializedDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/InvalidSerializedDefinitionController.java index 8cdbb9aa2f..cddbb8247f 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/InvalidSerializedDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/InvalidSerializedDefinitionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import java.io.PrintStream; @@ -32,7 +41,7 @@ public class InvalidSerializedDefinitionController { /** * View Invalid Serialized Definition Page */ - @RequestMapping("/module/reporting/definition/invalidSerializedDefinitions") + @RequestMapping("/module/reporting/definition/invalidSerializedDefinitions.form") public void invalidSerializedDefinitions(ModelMap model) { SerializedDefinitionService service = Context.getService(SerializedDefinitionService.class); @@ -55,7 +64,7 @@ public void invalidSerializedDefinitions(ModelMap model) { /** * Edit Invalid Serialized Definition Page */ - @RequestMapping("/module/reporting/definition/editInvalidSerializedDefinition") + @RequestMapping("/module/reporting/definition/editInvalidSerializedDefinition.form") public void editInvalidSerializedDefinition( @RequestParam(required=true, value="type") Class type, @RequestParam(required=true, value="uuid") String uuid, @@ -70,7 +79,7 @@ public void editInvalidSerializedDefinition( /** * Edit Invalid Serialized Definition Page */ - @RequestMapping("/module/reporting/definition/saveSerializedDefinition") + @RequestMapping("/module/reporting/definition/saveSerializedDefinition.form") public String saveSerializedDefinition(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam(required=true, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, @@ -96,7 +105,7 @@ public String saveSerializedDefinition(ModelMap model, HttpServletRequest reques /** * Edit Invalid Serialized Definition Page */ - @RequestMapping("/module/reporting/definition/testSerializedDefinition") + @RequestMapping("/module/reporting/definition/testSerializedDefinition.form") @SuppressWarnings("unchecked") public void testSerializedDefinition(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam(required=true, value="type") String type, @@ -120,7 +129,7 @@ public void testSerializedDefinition(ModelMap model, HttpServletRequest request, /** * Purges the definition represented by the given uuid. */ - @RequestMapping("/module/reporting/definition/purgeSerializedDefinition") + @RequestMapping("/module/reporting/definition/purgeSerializedDefinition.form") public String purgeSerializedDefinition(@RequestParam(required=true, value="uuid") String uuid) { SerializedDefinitionService sds = Context.getService(SerializedDefinitionService.class); sds.purgeDefinition(uuid); @@ -130,7 +139,7 @@ public String purgeSerializedDefinition(@RequestParam(required=true, value="uuid /** * Converts the definition represented by the given uuid using the given converter */ - @RequestMapping("/module/reporting/definition/convertDefinition") + @RequestMapping("/module/reporting/definition/convertDefinition.form") public String convertDefinition(@RequestParam(required=true, value="uuid") String uuid, @RequestParam(required=true, value="converter") Class converter) throws Exception { SerializedDefinitionService sds = Context.getService(SerializedDefinitionService.class); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageDefinitionsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageDefinitionsController.java index 8444bbead5..3ce0acb541 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageDefinitionsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageDefinitionsController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import java.util.ArrayList; @@ -43,7 +52,7 @@ public class ManageDefinitionsController { /** * Manage Definitions Controller */ - @RequestMapping("/module/reporting/definition/manageDefinitions") + @RequestMapping("/module/reporting/definition/manageDefinitions.form") public void manageDefinitions( @RequestParam(required=true, value="type") Class type, @RequestParam(required=false, value="includeRetired") Boolean includeRetired, @@ -105,7 +114,7 @@ else if (Query.class.isAssignableFrom(type)) { /** * Edit Definition Controller */ - @RequestMapping("/module/reporting/definition/editDefinition") + @RequestMapping("/module/reporting/definition/editDefinition.form") public String editDefinition( @RequestParam(required=true, value="type") Class type, @RequestParam(required=false, value="uuid") String uuid, @@ -124,7 +133,7 @@ public String editDefinition( /** * Purge Definition Controller */ - @RequestMapping("/module/reporting/definition/purgeDefinition") + @RequestMapping("/module/reporting/definition/purgeDefinition.form") public String purgeDefinition( @RequestParam(required=true, value="type") Class type, @RequestParam(required=true, value="uuid") String uuid, @@ -137,7 +146,7 @@ public String purgeDefinition( /** * Retire Definition Controller */ - @RequestMapping("/module/reporting/definition/retireDefinition") + @RequestMapping("/module/reporting/definition/retireDefinition.form") public String retireDefinition( @RequestParam(required=true, value="type") Class type, @RequestParam(required=true, value="uuid") String uuid, @@ -151,7 +160,7 @@ public String retireDefinition( /** * Retire Definition Controller */ - @RequestMapping("/module/reporting/definition/unretireDefinition") + @RequestMapping("/module/reporting/definition/unretireDefinition.form") public String unretireDefinition( @RequestParam(required=true, value="type") Class type, @RequestParam(required=true, value="uuid") String uuid, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageIndicatorsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageIndicatorsController.java index 79a040597b..e3c5f1879e 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageIndicatorsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ManageIndicatorsController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.apache.commons.logging.Log; @@ -17,13 +26,13 @@ public class ManageIndicatorsController { protected Log log = LogFactory.getLog(this.getClass()); - @RequestMapping("/module/reporting/indicators/manageIndicators") + @RequestMapping("/module/reporting/indicators/manageIndicators.form") public void manageIndicators(ModelMap model) { List indicators = Context.getService(IndicatorService.class).getAllDefinitions(false); model.addAttribute("indicators", indicators); } - @RequestMapping("/module/reporting/indicators/purgeIndicator") + @RequestMapping("/module/reporting/indicators/purgeIndicator.form") public String purgeIndicator(@RequestParam(required=false, value="uuid") String uuid) { Indicator indicator = Context.getService(IndicatorService.class).getDefinitionByUuid(uuid); if (indicator != null) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/QueryParameterFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/QueryParameterFormController.java index a50d7a9fe1..9d8c5eba13 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/QueryParameterFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/QueryParameterFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller; @@ -63,7 +59,7 @@ public void initBinder(WebDataBinder binder) { /** * Processes the form when a user submits. */ - @RequestMapping("/module/reporting/parameters/queryParameter") + @RequestMapping("/module/reporting/parameters/queryParameter.form") public ModelAndView processForm( HttpServletRequest request, HttpServletResponse response, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderLogicDataSetController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderLogicDataSetController.java index 543d4540f9..e8af13ae76 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderLogicDataSetController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderLogicDataSetController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller; @@ -31,7 +27,7 @@ @Controller public class RenderLogicDataSetController { - @RequestMapping("/module/reporting/reports/renderLogicDataSet") + @RequestMapping("/module/reporting/reports/renderLogicDataSet.form") public String showReport(Model model, HttpSession session, @RequestParam(required=false, value="start") Integer start, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderReportFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderReportFormController.java index 38a812d586..347b0d1717 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderReportFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/RenderReportFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.springframework.beans.propertyeditors.CustomDateEditor; @@ -22,7 +31,7 @@ public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(ymd, true)); } - @RequestMapping("/module/reporting/reports/renderDefaultReport") + @RequestMapping("/module/reporting/reports/renderDefaultReport.form") public ModelAndView renderDefaultReport() { return new ModelAndView("/module/reporting/reports/renderDefaultReport"); } diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ReportDashboardController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ReportDashboardController.java index dafb487d1b..582216a2f8 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ReportDashboardController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ReportDashboardController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.apache.commons.logging.Log; @@ -50,7 +59,7 @@ public void initBinder(WebDataBinder binder) { } - @RequestMapping("/module/reporting/dashboard/viewCohortDataSet") + @RequestMapping("/module/reporting/dashboard/viewCohortDataSet.form") public String viewCohortDataSet( @RequestParam(required=false, value="savedDataSetKey") String savedDataSetKey, @RequestParam(required=false, value="savedColumnKey") String savedColumnKey, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ScriptedCompositionPatientDataDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ScriptedCompositionPatientDataDefinitionController.java index 6c40e742b2..aebe578b27 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ScriptedCompositionPatientDataDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ScriptedCompositionPatientDataDefinitionController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller; @@ -34,7 +30,7 @@ public class ScriptedCompositionPatientDataDefinitionController { protected transient Log log = LogFactory.getLog(getClass()); @SuppressWarnings("unchecked") - @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinition") + @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinition.form") public void showForm(ModelMap model, @RequestParam(value = "uuid", required = false) String uuid, @RequestParam(value = "copyFromUuid", required = false) String copyFromUuid) { model.put("scriptTypes", TemplateEngineManager.getAvailableTemplateEngineNames()); @@ -53,7 +49,7 @@ public void showForm(ModelMap model, @RequestParam(value = "uuid", required = fa } } - @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinitionSetComposition") + @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinitionSetComposition.form") public String setScriptCode(@RequestParam("uuid") String uuid, @RequestParam("scriptCode") String scriptCode, @RequestParam("scriptType") String scriptType) { PatientDataDefinition def = Context.getService(PatientDataService.class).getDefinitionByUuid(uuid); @@ -71,7 +67,7 @@ public String setScriptCode(@RequestParam("uuid") String uuid, @RequestParam("sc * @param uuid * @return */ - @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinitionClone") + @RequestMapping("/module/reporting/definition/scriptedCompositionPatientDataDefinitionClone.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value = "description", required = false) String description, @RequestParam("copyFromUuid") String copyFromUuid) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/SqlDefinitionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/SqlDefinitionController.java index ec70e56d70..ba8ae42741 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/SqlDefinitionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/SqlDefinitionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.openmrs.api.context.Context; @@ -21,7 +30,7 @@ @Controller public class SqlDefinitionController { - @RequestMapping("/module/reporting/definition/sqlDefinition") + @RequestMapping("/module/reporting/definition/sqlDefinition.form") public void showForm(ModelMap model, @RequestParam(value="type", required=true) Class type, @RequestParam(value="uuid", required=false) String uuid, @@ -38,7 +47,7 @@ public void showForm(ModelMap model, model.addAttribute("type", type); } - @RequestMapping("/module/reporting/definition/sqlDefinitionAssignQueryString") + @RequestMapping("/module/reporting/definition/sqlDefinitionAssignQueryString.form") public String saveQueryString( HttpSession httpSession, WebRequest webRequest, @@ -82,7 +91,7 @@ else if (BaseSqlDataDefinition.class.isAssignableFrom(type)) { * Copies the SQL cohort definition with the given uuid into another one with the same * parameters and searches, but blank name/description and SQL string */ - @RequestMapping("/module/reporting/definition/sqlDefinitionClone") + @RequestMapping("/module/reporting/definition/sqlDefinitionClone.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value="description", required=false) String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ViewPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ViewPortletController.java index 19bc95e018..7fc81f8009 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/ViewPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/ViewPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller; import org.apache.commons.lang.StringUtils; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/AnnotatedDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/AnnotatedDefinitionMappingHandler.java index aeee49ac69..bfb41e0d37 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/AnnotatedDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/AnnotatedDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortCrossTabDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortCrossTabDataSetDefinitionMappingHandler.java index 342f6709d2..a0ac00f9d0 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortCrossTabDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortCrossTabDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortDefinitionMappingHandler.java index 051ceb7806..7b8f51489d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortIndicatorAndDimensionDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortIndicatorAndDimensionDataSetDefinitionMappingHandler.java index 2f440db800..509347fe65 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortIndicatorAndDimensionDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CohortIndicatorAndDimensionDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CompositionCohortDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CompositionCohortDefinitionMappingHandler.java index 07dba65642..fba69b583d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CompositionCohortDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/CompositionCohortDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DataSetDefinitionMappingHandler.java index c0bee61eba..e14a62942d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DefinitionMappingHandler.java index 1f29bdf472..360d81ad4e 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/DefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/IterableSqlDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/IterableSqlDataSetDefinitionMappingHandler.java new file mode 100644 index 0000000000..3a49d76c48 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/IterableSqlDataSetDefinitionMappingHandler.java @@ -0,0 +1,29 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.web.controller.mapping; + +import org.openmrs.annotation.Handler; +import org.openmrs.module.reporting.dataset.definition.IterableSqlDataSetDefinition; +import org.openmrs.module.reporting.evaluation.Definition; + +/** + * Handler that determines what pages are redirected for creating and editing IterableSqlDataSetDefinition + */ +@Handler(supports= IterableSqlDataSetDefinition.class, order=50) +public class IterableSqlDataSetDefinitionMappingHandler extends DefinitionMappingHandler { + + /** + * @see DefinitionMappingHandler#getCreateUrl(Class) + */ + public String getCreateUrl(Class type) { + return "/module/reporting/datasets/iterableSqlDataSetEditor.form?type="+type.getName(); + } +} + diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/LogicDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/LogicDataSetDefinitionMappingHandler.java index 012aa2a06d..d11196b8b1 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/LogicDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/LogicDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/MultiParameterDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/MultiParameterDataSetDefinitionMappingHandler.java index a98b2b4f95..12e1cbf465 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/MultiParameterDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/MultiParameterDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/PatientDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/PatientDataSetDefinitionMappingHandler.java index bbe70fb699..e435ba2b6a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/PatientDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/PatientDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/ScriptedCompositionPatientDataDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/ScriptedCompositionPatientDataDefinitionMappingHandler.java index aa22e6e55b..5813974a7e 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/ScriptedCompositionPatientDataDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/ScriptedCompositionPatientDataDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlCohortDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlCohortDefinitionMappingHandler.java index c312746cb2..90e93cbf09 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlCohortDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlCohortDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataDefinitionMappingHandler.java index 13cc1a9024..199287de17 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataSetDefinitionMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataSetDefinitionMappingHandler.java index 63015793e2..e5ec9578a4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataSetDefinitionMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlDataSetDefinitionMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlQueryMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlQueryMappingHandler.java index c8986efaf3..0e0cf0a220 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlQueryMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/SqlQueryMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/DelimitedTextReportRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/DelimitedTextReportRendererMappingHandler.java index 4b3c73cda6..57b2bb6ffa 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/DelimitedTextReportRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/DelimitedTextReportRendererMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping.renderers; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/ExcelTemplateRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/ExcelTemplateRendererMappingHandler.java index 0a67b6c8ae..d244d06b51 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/ExcelTemplateRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/ExcelTemplateRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/IndicatorReportRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/IndicatorReportRendererMappingHandler.java index c163535b99..1c96e2992b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/IndicatorReportRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/IndicatorReportRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/RendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/RendererMappingHandler.java index e667a5e32b..36d930c372 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/RendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/RendererMappingHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.mapping.renderers; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/SimpleHtmlReportRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/SimpleHtmlReportRendererMappingHandler.java index ecc1ac7699..0a172bc3e7 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/SimpleHtmlReportRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/SimpleHtmlReportRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/TextTemplateRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/TextTemplateRendererMappingHandler.java index 94d0b0e315..a5c07b3f26 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/TextTemplateRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/TextTemplateRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XlsReportRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XlsReportRendererMappingHandler.java index e89b592de3..9531199380 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XlsReportRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XlsReportRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XmlReportRendererMappingHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XmlReportRendererMappingHandler.java index 5ed9685491..063ed389f5 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XmlReportRendererMappingHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/mapping/renderers/XmlReportRendererMappingHandler.java @@ -1,17 +1,12 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ - package org.openmrs.module.reporting.web.controller.mapping.renderers; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/BaseCohortIndicatorPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/BaseCohortIndicatorPortletController.java index 753169e373..9612137d0e 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/BaseCohortIndicatorPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/BaseCohortIndicatorPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Map; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/CohortIndicatorAndDimensionSpecificationPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/CohortIndicatorAndDimensionSpecificationPortletController.java index dd742fc09d..29626785f6 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/CohortIndicatorAndDimensionSpecificationPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/CohortIndicatorAndDimensionSpecificationPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.ArrayList; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ErrorReportsPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ErrorReportsPortletController.java index befd7c678e..52a3a22979 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ErrorReportsPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ErrorReportsPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Collections; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletController.java index 724cae51b3..52356ed201 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.lang.reflect.Field; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletFormController.java index a06cd7a4e2..eb986d682b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MappedPropertyPortletFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.lang.reflect.Field; @@ -41,7 +50,7 @@ public MappedPropertyPortletFormController() { } /** * Saves mapped parameters */ - @RequestMapping("/module/reporting/reports/saveMappedProperty") + @RequestMapping("/module/reporting/reports/saveMappedProperty.form") @SuppressWarnings("unchecked") public String saveMappedProperty(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="type") Class type, @@ -142,7 +151,7 @@ else if (Mapped.class.isAssignableFrom(fieldType)) { /** * Remove mapped property */ - @RequestMapping("/module/reporting/reports/removeMappedProperty") + @RequestMapping("/module/reporting/reports/removeMappedProperty.form") @SuppressWarnings("unchecked") public String removeMappedProperty(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="type") Class type, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MultiParameterIterationParameterEditPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MultiParameterIterationParameterEditPortletController.java index 78859af124..d314b7b554 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MultiParameterIterationParameterEditPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/MultiParameterIterationParameterEditPortletController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.controller.portlet; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletController.java index f21b3ff24f..0c54944174 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Map; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletFormController.java index 7b574ac691..080b735db4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterPortletFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Collection; @@ -15,6 +24,7 @@ import org.openmrs.module.reporting.evaluation.parameter.Parameterizable; import org.openmrs.module.reporting.evaluation.parameter.ParameterizableUtil; import org.openmrs.web.WebConstants; +import org.openmrs.web.WebUtil; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.StringUtils; @@ -34,7 +44,7 @@ public ParameterPortletFormController() { } /** * Saves mapped parameters */ - @RequestMapping("/module/reporting/parameters/saveParameter") + @RequestMapping("/module/reporting/parameters/saveParameter.form") public String saveParameter(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="type") Class parentType, @RequestParam(required=true, value="uuid") String parentUuid, @@ -46,6 +56,11 @@ public String saveParameter(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="widgetConfiguration") String widgetConfiguration, @RequestParam(required=false, value="shortcut") String shortcut ) { + + currentName = WebUtil.escapeHTML(currentName); + newName = WebUtil.escapeHTML(newName); + label = WebUtil.escapeHTML(label); + widgetConfiguration = WebUtil.escapeHTML(widgetConfiguration); if (shortcut != null) { if (shortcut.equals("date")) { @@ -94,7 +109,7 @@ else if (shortcut.equals("location")) { /** * Remove mapped property */ - @RequestMapping("/module/reporting/parameters/deleteParameter") + @RequestMapping("/module/reporting/parameters/deleteParameter.form") public String deleteParameter(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="type") Class parentType, @RequestParam(required=true, value="uuid") String parentUuid, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletController.java index f2e0f93349..0d022d2a6a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Map; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletFormController.java index 7c80fdd2fb..e425e51751 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ParameterizablePortletFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import javax.servlet.http.HttpServletRequest; @@ -9,6 +18,7 @@ import org.openmrs.module.reporting.evaluation.parameter.Parameterizable; import org.openmrs.module.reporting.evaluation.parameter.ParameterizableUtil; import org.openmrs.web.WebConstants; +import org.openmrs.web.WebUtil; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; @@ -27,7 +37,7 @@ public ParameterizablePortletFormController() { } /** * Saves a BaseOpenmrsMetadata object */ - @RequestMapping("/module/reporting/reports/saveBaseParameterizable") + @RequestMapping("/module/reporting/reports/saveBaseParameterizable.form") public String saveBaseParameterizable(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="type") Class type, @RequestParam(required=true, value="uuid") String uuid, @@ -53,8 +63,8 @@ public String saveBaseParameterizable(ModelMap model, HttpServletRequest request throw new IllegalArgumentException("Cannot instantiate a new " + type, e); } } - p.setName(name); - p.setDescription(description); + p.setName(WebUtil.escapeHTML(name)); + p.setDescription(WebUtil.escapeHTML(description)); p = ParameterizableUtil.saveParameterizable(p); if (StringUtils.isNotEmpty(successUrl)) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/QueuedReportsPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/QueuedReportsPortletController.java index 7fcce9279b..15da806cd5 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/QueuedReportsPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/QueuedReportsPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.List; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignFormController.java index 86b2843a8f..3a3de2f66b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.HashSet; @@ -40,7 +49,7 @@ public ReportDesignFormController() { } /** * Saves report design */ - @RequestMapping("/module/reporting/reports/saveReportDesign") + @RequestMapping("/module/reporting/reports/saveReportDesign.form") @SuppressWarnings("unchecked") public String saveReportDesign(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @@ -124,7 +133,7 @@ else if (successUrl.startsWith(pathToRemove)) { /** * Delete report design */ - @RequestMapping("/module/reporting/reports/deleteReportDesign") + @RequestMapping("/module/reporting/reports/deleteReportDesign.form") public String deleteReportDesign(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="uuid") String uuid, @RequestParam(required=false, value="returnUrl") String returnUrl) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignPortletController.java index df5167951c..29a4394975 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportDesignPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Map; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportHistoryPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportHistoryPortletController.java index 03b40ece79..de346264c4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportHistoryPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportHistoryPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import org.openmrs.api.context.Context; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportListPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportListPortletController.java index 6e32b44510..eeb43dcb33 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportListPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportListPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.List; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorFormController.java index 22f8c97c4f..ea0d58fce4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorFormController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.Properties; @@ -5,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; +import org.owasp.encoder.Encode; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openmrs.api.context.Context; @@ -32,7 +42,7 @@ public ReportProcessorFormController() { } /** * Saves report design */ - @RequestMapping("/module/reporting/reports/saveReportProcessor") + @RequestMapping("/module/reporting/reports/saveReportProcessor.form") public String saveReportProcessor(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, @@ -52,7 +62,7 @@ public String saveReportProcessor(ModelMap model, HttpServletRequest request, c = new ReportProcessorConfiguration(); } - c.setName(name); + c.setName(Encode.forHtml(name)); c.setDescription(description); c.setProcessorType(processorType); c.setProcessorMode(processorMode); @@ -71,7 +81,7 @@ public String saveReportProcessor(ModelMap model, HttpServletRequest request, /** * Delete report design */ - @RequestMapping("/module/reporting/reports/deleteReportProcessor") + @RequestMapping("/module/reporting/reports/deleteReportProcessor.form") public String deleteReportDesign(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="uuid") String uuid, @RequestParam(required=false, value="returnUrl") String returnUrl) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorPortletController.java index c97411603e..a3851ec1ae 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportProcessorPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.ArrayList; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportingPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportingPortletController.java index f822ea5368..c18d246c7a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportingPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ReportingPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.io.IOException; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/RunReportPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/RunReportPortletController.java index 351fe123c9..21313f4c38 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/RunReportPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/RunReportPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import org.openmrs.api.context.Context; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/SavedReportsPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/SavedReportsPortletController.java index 78150b352f..428ae3c8a4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/SavedReportsPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/SavedReportsPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import org.openmrs.api.context.Context; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ScheduledReportsPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ScheduledReportsPortletController.java index 046704cef5..83090ea3f7 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ScheduledReportsPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/controller/portlet/ScheduledReportsPortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.controller.portlet; import java.util.List; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortDataSetEditor.java index bf938dd2ed..ef6f5ee106 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortDataSetEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.datasets; import org.apache.commons.logging.Log; @@ -24,7 +33,7 @@ public CohortDataSetEditor() { } /** * Retrieves either an existing or new report to edit */ - @RequestMapping("/module/reporting/datasets/cohortDatasetEditor") + @RequestMapping("/module/reporting/datasets/cohortDatasetEditor.form") public void editCohortDataSet(ModelMap model, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=false, value="type") Class type) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortIndicatorAndDimensionDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortIndicatorAndDimensionDataSetEditor.java index 8bf9a29574..b3801f0b21 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortIndicatorAndDimensionDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/CohortIndicatorAndDimensionDataSetEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.datasets; import java.util.ArrayList; @@ -39,7 +48,7 @@ public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Indicator.class, new IndicatorEditor()); } - @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionDatasetEditor") + @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionDatasetEditor.form") public void editDataSet(ModelMap model, @RequestParam(value="uuid", required=false) String uuid) { DataSetDefinition dsd = new CohortIndicatorAndDimensionDataSetDefinition(); if (uuid != null) { @@ -48,7 +57,7 @@ public void editDataSet(ModelMap model, @RequestParam(value="uuid", required=fal model.addAttribute("dsd", dsd); } - @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionAddSpecification") + @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionAddSpecification.form") public String addSpecification(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("index") Integer index, @RequestParam("indicatorNumber") String indicatorNumber, @@ -124,7 +133,7 @@ public int compare(CohortIndicatorAndDimensionSpecification s1, CohortIndicatorA return "redirect:/module/reporting/closeWindow.htm"; } - @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionRemoveIndicator") + @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionRemoveIndicator.form") public String removeIndicator(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("index") Integer index) { @@ -136,7 +145,7 @@ public String removeIndicator(@RequestParam("dsdUuid") String dsdUuid, return "redirect:cohortIndicatorAndDimensionDatasetEditor.form?uuid=" + dsdUuid; } - @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionRemoveDimension") + @RequestMapping("/module/reporting/datasets/cohortIndicatorAndDimensionRemoveDimension.form") public String removeDimension(@RequestParam("uuid") String uuid, @RequestParam("key") String key) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/IterableSqlDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/IterableSqlDataSetEditor.java new file mode 100644 index 0000000000..a02360de68 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/IterableSqlDataSetEditor.java @@ -0,0 +1,97 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + *

+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.web.datasets; + +import org.openmrs.api.context.Context; +import org.openmrs.module.reporting.cohort.query.service.CohortQueryService; +import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.IterableSqlDataSetDefinition; +import org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService; +import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.web.WebConstants; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.context.request.WebRequest; + +import javax.servlet.http.HttpSession; +import java.util.List; + +@Controller +public class IterableSqlDataSetEditor { + + @RequestMapping("/module/reporting/datasets/iterableSqlDataSetEditor") + public void showForm(ModelMap model, + @RequestParam(value = "uuid", required = false) String uuid, + @RequestParam(value = "copyFromUuid", required = false) String copyFromUuid) { + if (uuid == null) { + model.addAttribute("definition", new IterableSqlDataSetDefinition()); + } else { + DataSetDefinition def = Context.getService(DataSetDefinitionService.class).getDefinitionByUuid(uuid); + if (def instanceof IterableSqlDataSetDefinition) { + IterableSqlDataSetDefinition definition = (IterableSqlDataSetDefinition) def; + model.addAttribute("definition", definition); + } else { + throw new RuntimeException("This definition does not correspond to an IterableSqlDataSetDefinition."); + } + } + } + + @RequestMapping("/module/reporting/datasets/iterableSqlDataSetDefinitionAssignQueryString") + public String saveQueryString( + HttpSession httpSession, + WebRequest webRequest, + @RequestParam("uuid") String uuid, + @RequestParam("queryString") String queryString) { + + DataSetDefinition def = Context.getService(DataSetDefinitionService.class).getDefinitionByUuid(uuid); + IterableSqlDataSetDefinition definition = (IterableSqlDataSetDefinition) def; + definition.setSql(queryString); + + List parameters = Context.getService(CohortQueryService.class).getNamedParameters(queryString); + for (Parameter parameter : parameters) { + if (definition.getParameter(parameter.getName()) == null) + definition.addParameter(parameter); + } + + // Save the definition + Context.getService(DataSetDefinitionService.class).saveDefinition(definition); + httpSession.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "reporting.IterableSqlDataSetDefinition.saved"); + httpSession.setAttribute(WebConstants.OPENMRS_MSG_ARGS, queryString); + return "redirect:iterableSqlDataSetEditor.form?uuid=" + uuid; + } + + /** + * Copies the SQL DataSet definition with the given uuid into another one with the same + * parameters and searches, but blank name/description and SQL string + * + * @return + */ + @RequestMapping("/module/reporting/datasets/iterableSqlDataSetDefinitionClone") + public String cloneDefinition(WebRequest request, + @RequestParam("name") String name, + @RequestParam(value = "description", required = false) String description, + @RequestParam("copyFromUuid") String copyFromUuid) { + DataSetDefinition def = Context.getService(DataSetDefinitionService.class).getDefinitionByUuid(copyFromUuid); + IterableSqlDataSetDefinition from = (IterableSqlDataSetDefinition) def; + + IterableSqlDataSetDefinition clone = new IterableSqlDataSetDefinition(); + clone.setId(null); + clone.setUuid(null); + clone.setName(name); + clone.setDescription(description); + clone.setParameters(from.getParameters()); + clone.setSql(from.getSql()); + Context.getService(DataSetDefinitionService.class).saveDefinition(clone); + request.setAttribute(WebConstants.OPENMRS_MSG_ATTR, "Saved as a new copy", WebRequest.SCOPE_SESSION); + return "redirect:iterableSqlDataSetEditor.form?uuid=" + clone.getUuid(); + } +} diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/LogicDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/LogicDataSetEditor.java index db341fde9c..8b38b2c35a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/LogicDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/LogicDataSetEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.datasets; @@ -19,11 +15,15 @@ import java.util.List; import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openmrs.api.context.Context; import org.openmrs.logic.LogicException; +import org.openmrs.module.ModuleFactory; import org.openmrs.module.reporting.common.LogicUtil; import org.openmrs.module.reporting.dataset.definition.LogicDataSetDefinition; import org.openmrs.module.reporting.dataset.definition.LogicDataSetDefinition.Column; @@ -40,11 +40,14 @@ public class LogicDataSetEditor { Log log = LogFactory.getLog(getClass()); - @RequestMapping("/module/reporting/datasets/logicDataSetEditor") - public void showDataset(ModelMap model, @RequestParam(required = false, value = "uuid") String uuid) { + @RequestMapping("/module/reporting/datasets/logicDataSetEditor.form") + public void showDataset(HttpServletRequest request, ModelMap model, @RequestParam(required = false, value = "uuid") String uuid) { DataSetDefinitionService svc = Context.getService(DataSetDefinitionService.class); LogicDataSetDefinition definition = (LogicDataSetDefinition) svc.getDefinition(uuid, LogicDataSetDefinition.class); + HttpSession httpSession = request.getSession(); + if(ModuleFactory.isModuleStarted("logic")) { + List tokens = new ArrayList(Context.getLogicService().getAllTokens()); Collections.sort(tokens); @@ -62,9 +65,13 @@ public void showDataset(ModelMap model, @RequestParam(required = false, value = model.addAttribute("logicErrors", logicErrors); model.addAttribute("tokens", tokens); model.addAttribute("conceptNameTags", Context.getConceptService().getAllConceptNameTags()); + }else { + + httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "reporting.logicModuleNotStarted.error"); + } } - @RequestMapping("/module/reporting/datasets/logicDataSetEditorSave") + @RequestMapping("/module/reporting/datasets/logicDataSetEditorSave.form") public String saveLogicDataset(ModelMap model, @RequestParam(required = false, value = "uuid") String uuid, @RequestParam(required = false, value = "name") String name, @RequestParam(required = false, value = "description") String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/ManageDatasetsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/ManageDatasetsController.java index bf85121140..15582616e6 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/ManageDatasetsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/ManageDatasetsController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.datasets; import org.apache.commons.logging.Log; @@ -8,13 +17,19 @@ import org.openmrs.module.reporting.common.ReflectionUtil; import org.openmrs.module.reporting.dataset.definition.DataSetDefinition; import org.openmrs.module.reporting.dataset.definition.service.DataSetDefinitionService; +import org.openmrs.module.reporting.definition.DefinitionSummary; import org.openmrs.module.reporting.definition.DefinitionUtil; import org.openmrs.module.reporting.definition.configuration.Property; +import org.openmrs.module.reporting.evaluation.Definition; +import org.openmrs.module.reporting.evaluation.parameter.Mapped; import org.openmrs.module.reporting.evaluation.parameter.Parameter; +import org.openmrs.module.reporting.report.definition.ReportDefinition; +import org.openmrs.module.reporting.report.definition.service.ReportDefinitionService; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; @@ -27,11 +42,11 @@ public class ManageDatasetsController { protected Log log = LogFactory.getLog(this.getClass()); - + /** * Controller for the edit data set page */ - @RequestMapping("/module/reporting/datasets/editDataSet") + @RequestMapping("/module/reporting/datasets/editDataSet.form") public String editDataSet( @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=false, value="type") Class type, @@ -57,12 +72,36 @@ public String editDataSet( model.addAttribute("groupedProperties", groups); return "/module/reporting/datasets/datasetEditor"; - } + } + + /* + * Load Affected Report Definitions. + */ + @RequestMapping("/module/reporting/datasets/loadAffectedDatasetDefs.form") + @ResponseBody() + public List loadAffectedDatasetDefs(@RequestParam(required=true,value="uuid")String uuid){ + List reportDefinitions = Context.getService(ReportDefinitionService.class).getAllDefinitions(false); + List affectedReportDefs = new ArrayList(); + for (ReportDefinition reportDef : reportDefinitions) { + List> dsds = new + ArrayList>(reportDef.getDataSetDefinitions().values()); + if (!dsds.isEmpty()) { + for (Mapped dataSet : dsds) { + if (uuid.equals(dataSet.getUuidOfMappedOpenmrsObject())) { + DefinitionSummary affectedRep = new DefinitionSummary(dataSet.getParameterizable()); + affectedReportDefs.add(affectedRep); + } + } + } + } + + return affectedReportDefs; + } /** * Save DataSetDefinition */ - @RequestMapping("/module/reporting/datasets/saveDataSet") + @RequestMapping("/module/reporting/datasets/saveDataSet.form") @SuppressWarnings("unchecked") public String saveDataSet( @RequestParam(required=false, value="uuid") String uuid, @@ -110,4 +149,5 @@ public String saveDataSet( return "redirect:/module/reporting/definition/manageDefinitions.form?type=org.openmrs.module.reporting.dataset.definition.DataSetDefinition"; } + } diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/MultiParameterDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/MultiParameterDataSetEditor.java index 573f3d2551..6d64c94fd3 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/MultiParameterDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/MultiParameterDataSetEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.datasets; import org.apache.commons.lang.StringUtils; @@ -24,7 +33,7 @@ @Controller public class MultiParameterDataSetEditor { - @RequestMapping("/module/reporting/datasets/multiParameterDataSetEditor") + @RequestMapping("/module/reporting/datasets/multiParameterDataSetEditor.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid) { List allDefinitions = Context.getService(DataSetDefinitionService.class).getAllDefinitions(false); @@ -42,7 +51,7 @@ public void showForm(ModelMap model, model.addAttribute("availableDefinitions", allDefinitions); } - @RequestMapping("/module/reporting/datasets/multiParameterAddIteration") + @RequestMapping("/module/reporting/datasets/multiParameterAddIteration.form") public String addIteration(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("index") Integer index) { @@ -57,7 +66,7 @@ public String addIteration(@RequestParam("dsdUuid") String dsdUuid, return "redirect:multiParameterDataSetEditor.form?uuid=" + dsdUuid; } - @RequestMapping("/module/reporting/datasets/multiParameterRemoveIteration") + @RequestMapping("/module/reporting/datasets/multiParameterRemoveIteration.form") public String removeIteration(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("index") Integer index) { DataSetDefinition dsd = DefinitionContext.getDataSetDefinitionService().getDefinitionByUuid(dsdUuid); @@ -69,7 +78,7 @@ public String removeIteration(@RequestParam("dsdUuid") String dsdUuid, return "redirect:multiParameterDataSetEditor.form?uuid=" + dsdUuid; } - @RequestMapping("/module/reporting/datasets/multiParameterEditIterationParameter") + @RequestMapping("/module/reporting/datasets/multiParameterEditIterationParameter.form") public String editIterationParameter(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("iteration") Integer iteration, @RequestParam("parameterName") String parameterName, @@ -99,7 +108,7 @@ public String editIterationParameter(@RequestParam("dsdUuid") String dsdUuid, return "redirect:/module/reporting/closeWindow.htm"; } - @RequestMapping("/module/reporting/datasets/multiParameterChangeBaseDefinition") + @RequestMapping("/module/reporting/datasets/multiParameterChangeBaseDefinition.form") public String changeBaseDefinition(@RequestParam("dsdUuid") String dsdUuid, @RequestParam("baseDefinitionUuid") String baseDefinitionUuid) { DataSetDefinition dsd = DefinitionContext.getDataSetDefinitionService().getDefinitionByUuid(dsdUuid); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/PatientDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/PatientDataSetEditor.java index 5d36ef8652..4430f42498 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/PatientDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/PatientDataSetEditor.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.datasets; @@ -23,6 +19,7 @@ import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.openmrs.api.context.Context; @@ -128,7 +125,7 @@ private PatientDataSetDefinition getFromSession(HttpSession session) { } } - @RequestMapping("/module/reporting/datasets/patientDataSetEditor") + @RequestMapping("/module/reporting/datasets/patientDataSetEditor.form") public void showDataset(HttpSession session, Model model) { model.addAttribute("unsaved", session.getAttribute(IS_UNSAVED_ATTR)); @@ -136,7 +133,7 @@ public void showDataset(HttpSession session, model.addAttribute("dataDefinitionTypes", PatientDataDefinition.class.getName() + "," + PersonDataDefinition.class.getName()); } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-nameDescription", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-nameDescription.form", method=RequestMethod.POST) public String changeNameAndDescription(@RequestParam("name") String name, @RequestParam("description") String description, HttpSession session) { @@ -147,7 +144,7 @@ public String changeNameAndDescription(@RequestParam("name") String name, return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addParam", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addParam.form", method=RequestMethod.POST) public String addParameter(@RequestParam(value="collectionType", required=false) Class> collectionType, @RequestParam(value="parameterType", required=false) Class parameterType, @RequestParam(value="name", required=false) String name, @@ -170,7 +167,7 @@ public String addParameter(@RequestParam(value="collectionType", required=false) return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeParam", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeParam.form", method=RequestMethod.POST) public String removeParameter(@RequestParam("name") String name, HttpSession session) { PatientDataSetDefinition dsd = getFromSession(session); @@ -179,7 +176,7 @@ public String removeParameter(@RequestParam("name") String name, return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addColumn", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addColumn.form", method=RequestMethod.POST) public String addColumn(@RequestParam(value="label", required=false) String label, @RequestParam(value="columnDefinition", required=false) String columnDefinition, HttpSession session) { @@ -197,7 +194,7 @@ public String addColumn(@RequestParam(value="label", required=false) String labe } MappedEditor editor = new MappedEditor(); - editor.setAsText(columnDefinition); + editor.setAsText(StringEscapeUtils.unescapeXml(columnDefinition)); Mapped mappedDef = (Mapped) editor.getValue(); dsd.addColumn(label, mappedDef.getParameterizable(), mappedDef.getParameterMappings()); @@ -205,7 +202,7 @@ public String addColumn(@RequestParam(value="label", required=false) String labe return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeColumn", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeColumn.form", method=RequestMethod.POST) public String removeColumn(@RequestParam("name") String name, HttpSession session) { PatientDataSetDefinition dsd = getFromSession(session); @@ -214,7 +211,7 @@ public String removeColumn(@RequestParam("name") String name, return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addFilter", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-addFilter.form", method=RequestMethod.POST) public String addFilter(@RequestParam(value="filterDefinition", required=false) String filterDefinition, HttpSession session) { if (StringUtils.isBlank(filterDefinition)) { @@ -233,7 +230,7 @@ public String addFilter(@RequestParam(value="filterDefinition", required=false) return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeFilter", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-removeFilter.form", method=RequestMethod.POST) public String removeFilter(@RequestParam("filterIndex") int index, HttpSession session) { PatientDataSetDefinition dsd = getFromSession(session); @@ -242,7 +239,7 @@ public String removeFilter(@RequestParam("filterIndex") int index, return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-sortColumns", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-sortColumns.form", method=RequestMethod.POST) public String sortColumns(WebRequest request, HttpSession session) { final List columnOrder = new ArrayList(); @@ -267,7 +264,7 @@ public int compare(RowPerObjectColumnDefinition left, RowPerObjectColumnDefiniti return "redirect:patientDataSetEditor.form"; } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-save", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-save.form", method=RequestMethod.POST) public String save(HttpSession session) { PatientDataSetDefinition dsd = getFromSession(session); String successUrl = (String) session.getAttribute(SUCCESS_URL_ATTR); @@ -283,7 +280,7 @@ public String save(HttpSession session) { } } - @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-discard", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/datasets/patientDataSetEditor-discard.form", method=RequestMethod.POST) public String discard(HttpSession session) { String discardUrl = (String) session.getAttribute(DISCARD_URL_ATTR); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/SqlDataSetEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/SqlDataSetEditor.java index b2d0c92429..3135d4aa57 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/datasets/SqlDataSetEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/datasets/SqlDataSetEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.datasets; import java.util.List; @@ -20,7 +29,7 @@ @Controller public class SqlDataSetEditor { - @RequestMapping("/module/reporting/datasets/sqlDataSetEditor") + @RequestMapping("/module/reporting/datasets/sqlDataSetEditor.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid, @RequestParam(value="copyFromUuid", required=false) String copyFromUuid) { @@ -39,7 +48,7 @@ public void showForm(ModelMap model, } } - @RequestMapping("/module/reporting/datasets/sqlDataSetDefinitionAssignQueryString") + @RequestMapping("/module/reporting/datasets/sqlDataSetDefinitionAssignQueryString.form") public String saveQueryString( HttpSession httpSession, WebRequest webRequest, @@ -70,7 +79,7 @@ public String saveQueryString( * @param uuid * @return */ - @RequestMapping("/module/reporting/datasets/sqlDataSetDefinitionClone") + @RequestMapping("/module/reporting/datasets/sqlDataSetDefinitionClone.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value="description", required=false) String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/EditCohortDefinitionDimensionController.java b/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/EditCohortDefinitionDimensionController.java index 9966a068ea..7afaf97745 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/EditCohortDefinitionDimensionController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/EditCohortDefinitionDimensionController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.dimensions; import org.openmrs.api.context.Context; @@ -11,7 +20,7 @@ @Controller public class EditCohortDefinitionDimensionController { - @RequestMapping("/module/reporting/indicators/editCohortDefinitionDimension") + @RequestMapping("/module/reporting/indicators/editCohortDefinitionDimension.form") public void editReportDefinition( @RequestParam(required=false, value="uuid") String uuid, ModelMap model) { @@ -21,7 +30,7 @@ public void editReportDefinition( model.addAttribute("dimension", dim); } - @RequestMapping("/module/reporting/indicators/editCohortDefinitionDimensionRemoveOption") + @RequestMapping("/module/reporting/indicators/editCohortDefinitionDimensionRemoveOption.form") public String removeOption( @RequestParam("uuid") String uuid, @RequestParam("key") String keyToRemove) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/ManageDimensionsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/ManageDimensionsController.java index d6e6c91b11..88da882036 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/ManageDimensionsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/dimensions/ManageDimensionsController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.dimensions; import java.util.List; @@ -19,7 +28,7 @@ public class ManageDimensionsController { /** * List all dimensions */ - @RequestMapping("/module/reporting/indicators/manageDimensions") + @RequestMapping("/module/reporting/indicators/manageDimensions.form") public void manageDimensions(ModelMap model, @RequestParam(required=false, value="includeRetired") Boolean includeRetired) { @@ -37,7 +46,7 @@ public void manageDimensions(ModelMap model, /** * Delete an existing dimension */ - @RequestMapping("/module/reporting/indicators/purgeDimension") + @RequestMapping("/module/reporting/indicators/purgeDimension.form") public String purgeDimension(@RequestParam("uuid") String uuid) { DimensionService service = Context.getService(DimensionService.class); Dimension dim = service.getDefinitionByUuid(uuid); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/extension/GutterListExt.java b/omod/src/main/java/org/openmrs/module/reporting/web/extension/GutterListExt.java index 21820ef877..f803b1fec2 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/extension/GutterListExt.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/extension/GutterListExt.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.extension; import org.openmrs.module.web.extension.LinkExt; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/extension/ManageAdminListExt.java b/omod/src/main/java/org/openmrs/module/reporting/web/extension/ManageAdminListExt.java index b1614ba7fd..3158f021cb 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/extension/ManageAdminListExt.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/extension/ManageAdminListExt.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.extension; import java.util.LinkedHashMap; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/extension/RunAdminListExt.java b/omod/src/main/java/org/openmrs/module/reporting/web/extension/RunAdminListExt.java index 023e0eaf51..49c9af045d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/extension/RunAdminListExt.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/extension/RunAdminListExt.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.extension; import java.util.LinkedHashMap; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditCohortIndicatorController.java b/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditCohortIndicatorController.java index 80314462f2..c3b33d30e4 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditCohortIndicatorController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditCohortIndicatorController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.indicator; import org.openmrs.api.context.Context; @@ -16,7 +25,7 @@ @Controller public class EditCohortIndicatorController { - @RequestMapping("/module/reporting/indicators/editCohortIndicator") + @RequestMapping("/module/reporting/indicators/editCohortIndicator.form") public void editCohortIndicator(ModelMap model, @RequestParam(value="uuid", required=false) String uuid) { if (uuid == null) { @@ -28,7 +37,7 @@ public void editCohortIndicator(ModelMap model, } } - @RequestMapping("/module/reporting/indicators/saveBaseCohortIndicator") + @RequestMapping("/module/reporting/indicators/saveBaseCohortIndicator.form") public String saveBaseCohortIndicator(ModelMap model, @RequestParam(value="uuid", required=false) String uuid, @RequestParam(value="name", required=true) String name, @@ -70,7 +79,7 @@ public String saveBaseCohortIndicator(ModelMap model, } } - @RequestMapping("/module/reporting/indicators/saveLogicCohortIndicator") + @RequestMapping("/module/reporting/indicators/saveLogicCohortIndicator.form") @SuppressWarnings("unchecked") public String saveLogicCohortIndicator(ModelMap model, @RequestParam(value="uuid", required=true) String uuid, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditSqlIndicatorController.java b/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditSqlIndicatorController.java index 8d93eb9ef4..72349607df 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditSqlIndicatorController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/indicator/EditSqlIndicatorController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.indicator; import java.util.List; @@ -20,7 +29,7 @@ @Controller public class EditSqlIndicatorController { - @RequestMapping("/module/reporting/indicators/editSqlIndicator") + @RequestMapping("/module/reporting/indicators/editSqlIndicator.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid, @RequestParam(value="copyFromUuid", required=false) String copyFromUuid) { @@ -39,7 +48,7 @@ public void showForm(ModelMap model, } } - @RequestMapping("/module/reporting/indicators/saveSqlIndicatorQueryString") + @RequestMapping("/module/reporting/indicators/saveSqlIndicatorQueryString.form") public String saveQueryString( HttpSession httpSession, WebRequest webRequest, @@ -68,7 +77,7 @@ public String saveQueryString( * Copies the SQL Indicator with the given uuid into another one with the same * parameters and searches, but blank name/description and SQL string */ - @RequestMapping("/module/reporting/indicators/cloneSqlIndicator") + @RequestMapping("/module/reporting/indicators/cloneSqlIndicator.form") public String cloneDefinition(WebRequest request, @RequestParam("name") String name, @RequestParam(value="description", required=false) String description, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/model/IndicatorForm.java b/omod/src/main/java/org/openmrs/module/reporting/web/model/IndicatorForm.java index c7b13a9857..19573a7b63 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/model/IndicatorForm.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/model/IndicatorForm.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.model; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/CurrentReportController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/CurrentReportController.java index 039abd53a4..bedc5d1bf1 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/CurrentReportController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/CurrentReportController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.reports; import org.openmrs.module.reporting.ReportingConstants; @@ -11,7 +20,7 @@ @Controller public class CurrentReportController { - @RequestMapping("/module/reporting/run/currentReportDiscard") + @RequestMapping("/module/reporting/run/currentReportDiscard.form") public String discardFromSession(WebRequest request) { request.removeAttribute(ReportingConstants.OPENMRS_REPORT_DATA, WebRequest.SCOPE_SESSION); request.removeAttribute(ReportingConstants.OPENMRS_REPORT_ARGUMENT, WebRequest.SCOPE_SESSION); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/LogicReportController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/LogicReportController.java index 3bae22029a..7c28b5d96a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/LogicReportController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/LogicReportController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; @@ -30,7 +26,7 @@ @Controller public class LogicReportController { - @RequestMapping("/module/reporting/reports/logicReport") + @RequestMapping("/module/reporting/reports/logicReport.form") public String showFormOrRedirect(@RequestParam(required=false, value="uuid") String uuid) { if (uuid != null) { // TODO find the logic dataset in this report, and redirect to its edit page @@ -39,7 +35,7 @@ public String showFormOrRedirect(@RequestParam(required=false, value="uuid") Str return null; // show the default view } - @RequestMapping("/module/reporting/reports/logicReportCreate") + @RequestMapping("/module/reporting/reports/logicReportCreate.form") public String createLogicReport(@RequestParam("name") String name, @RequestParam(required=false, value="description") String description) { LogicDataSetDefinition dsd = new LogicDataSetDefinition(); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportQueuePortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportQueuePortletController.java index edf2df2fe5..35c2ee06bb 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportQueuePortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportQueuePortletController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.reports; import java.util.HashMap; @@ -22,7 +31,7 @@ @Order(50) public class ManageReportQueuePortletController extends ReportingPortletController { - @RequestMapping(value = "/module/reporting/portlets/manageReportQueue") + @RequestMapping(value = "/module/reporting/portlets/manageReportQueue.form") public void showReportRequests() { //this method is just to get the controller registered for the portlet's url. //The model data is added from populateModel() method below diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportsController.java index 251c3a488f..ffd70e629b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageReportsController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; @@ -65,7 +61,7 @@ public ManageReportsController() { } * Provide all reports, optionally including those that are retired, to a page * that lists them and provides options for working with these reports. */ - @RequestMapping("/module/reporting/reports/manageReports") + @RequestMapping("/module/reporting/reports/manageReports.form") public ModelMap manageReports(ModelMap model, @RequestParam(required=false, value="includeRetired") Boolean includeRetired) { @@ -88,7 +84,7 @@ public ModelMap manageReports(ModelMap model, * Provide all reports designs, optionally including those that are retired, to a page * that lists them and provides options for working with them. */ - @RequestMapping("/module/reporting/reports/manageReportDesigns") + @RequestMapping("/module/reporting/reports/manageReportDesigns.form") public ModelMap manageReportDesigns(ModelMap model, @RequestParam(required=false, value="includeRetired") Boolean includeRetired) { @@ -106,7 +102,7 @@ public ModelMap manageReportDesigns(ModelMap model, * * to edit a reportDefinition based on its rendererType. */ - @RequestMapping("/module/reporting/reports/renderers/editReportDesign") + @RequestMapping("/module/reporting/reports/renderers/editReportDesign.form") public String editReportDesign(ModelMap model, @RequestParam(required=true, value="type") Class type, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @@ -147,7 +143,7 @@ public String editReportDesign(ModelMap model, * * Edit page for a report design that does not have a custom editor */ - @RequestMapping("/module/reporting/reports/renderers/defaultReportDesignEditor") + @RequestMapping("/module/reporting/reports/renderers/defaultReportDesignEditor.form") public void defaultReportDesignRenderer(ModelMap model, @RequestParam(required=true, value="type") Class type, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @@ -171,7 +167,7 @@ public void defaultReportDesignRenderer(ModelMap model, /** * Provide all reports processor configurations, to a page that lists them and provides options for working with them. */ - @RequestMapping("/module/reporting/reports/manageReportProcessors") + @RequestMapping("/module/reporting/reports/manageReportProcessors.form") public void manageReportProcessors(ModelMap model) { List configs = Context.getService(ReportService.class).getAllReportProcessorConfigurations(false); model.addAttribute("reportProcessorConfigurations", configs); @@ -181,7 +177,7 @@ public void manageReportProcessors(ModelMap model) { * Provide all reports designs, optionally including those that are retired, to a page * that lists them and provides options for working with them. */ - @RequestMapping("/module/reporting/reports/viewReportDesignResource") + @RequestMapping("/module/reporting/reports/viewReportDesignResource.form") public void viewDesignContent(ModelMap model, HttpServletResponse response, @RequestParam(required=true, value="designUuid") String designUuid, @@ -202,7 +198,7 @@ public void viewDesignContent(ModelMap model, } } - @RequestMapping("/module/reporting/reports/purgeReport") + @RequestMapping("/module/reporting/reports/purgeReport.form") public String purgeReportDefinition(@RequestParam(required=false, value="uuid") String uuid) { ReportDefinitionService rds = Context.getService(ReportDefinitionService.class); rds.purgeDefinition(rds.getDefinitionByUuid(uuid)); @@ -213,7 +209,7 @@ public String purgeReportDefinition(@RequestParam(required=false, value="uuid") * Renders a report to the response output stream, given a report definition, rendering mode, and optional patient id * @param patientIdOrUuid the id or uuid of patient whose summary you wish to view */ - @RequestMapping("/module/reporting/reports/renderReport") + @RequestMapping("/module/reporting/reports/renderReport.form") public void renderReport(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam("reportDefinition") String reportDefinitionUuid, @RequestParam("renderingMode") String renderingModeDescriptor, @@ -254,7 +250,7 @@ public void renderReport(ModelMap model, HttpServletRequest request, HttpServlet else { List l = new ArrayList(); for (String v : parameterValues) { - l.add(WidgetUtil.parseInput(parameterValues[0], p.getType())); + l.add(WidgetUtil.parseInput(v, p.getType())); } value = l; } diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageScheduledReportsController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageScheduledReportsController.java index 7c3a950472..4241de6f67 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageScheduledReportsController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ManageScheduledReportsController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; @@ -44,7 +40,7 @@ public ManageScheduledReportsController() { } /** * Provide all scheduled reports for working with these reports. */ - @RequestMapping("/module/reporting/reports/manageScheduledReports") + @RequestMapping("/module/reporting/reports/manageScheduledReports.form") public ModelMap manageReports(ModelMap model) { // getting all currently scheduled reports ReportService reportService = Context.getService(ReportService.class); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/PeriodIndicatorReportController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/PeriodIndicatorReportController.java index 7498392ad9..a6b06c2738 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/PeriodIndicatorReportController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/PeriodIndicatorReportController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.reports; import java.util.ArrayList; @@ -62,7 +71,7 @@ public List getIndicators() { return ret; } - @RequestMapping("/module/reporting/reports/periodIndicatorReport") + @RequestMapping("/module/reporting/reports/periodIndicatorReport.form") public void showForm(ModelMap model, @RequestParam(value="uuid", required=false) String uuid) { if (uuid == null) { @@ -80,7 +89,7 @@ public void showForm(ModelMap model, } - @RequestMapping("/module/reporting/reports/periodIndicatorReportSaveColumn") + @RequestMapping("/module/reporting/reports/periodIndicatorReportSaveColumn.form") public String addColumn(@RequestParam("uuid") String uuid, @RequestParam(value="index", required=false) Integer index, @RequestParam("key") String key, @@ -138,7 +147,7 @@ public String addColumn(@RequestParam("uuid") String uuid, return "redirect:periodIndicatorReport.form?uuid=" + uuid; } - @RequestMapping("/module/reporting/reports/periodIndicatorReportRemoveColumn") + @RequestMapping("/module/reporting/reports/periodIndicatorReportRemoveColumn.form") public String removeColumn(@RequestParam("uuid") String uuid, @RequestParam("key") String key) { @@ -148,7 +157,7 @@ public String removeColumn(@RequestParam("uuid") String uuid, return "redirect:periodIndicatorReport.form?uuid=" + uuid; } - @RequestMapping("/module/reporting/reports/periodIndicatorReportRemoveDimension") + @RequestMapping("/module/reporting/reports/periodIndicatorReportRemoveDimension.form") public String removeDimension(@RequestParam("uuid") String uuid, @RequestParam("key") String key) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportEditor.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportEditor.java index e35d126522..354973880d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportEditor.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportEditor.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.reports; import java.util.List; @@ -29,7 +38,7 @@ public ReportEditor() { /** * Retrieves either an existing or new report to edit */ - @RequestMapping("/module/reporting/reports/reportEditor") + @RequestMapping("/module/reporting/reports/reportEditor.form") public void editReport(ModelMap model, @RequestParam(required = false, value = "uuid") String uuid, @RequestParam(required = false, value = "type") Class type) { diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportHistoryController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportHistoryController.java index 572497da3e..bcec778d4c 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportHistoryController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportHistoryController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.reports; import org.apache.commons.io.IOUtils; @@ -68,7 +77,7 @@ public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true, 10)); } - @RequestMapping("/module/reporting/reports/reportHistory") + @RequestMapping("/module/reporting/reports/reportHistory.form") public void showReportHistory(ModelMap model, @RequestParam(value="reportDefinition", required=false) ReportDefinition reportDefinition, @RequestParam(value="requestedBy", required=false) User requestedBy, @@ -114,7 +123,7 @@ public void showReportHistory(ModelMap model, model.addAttribute("renderingModes", renderingModes); } - @RequestMapping("/module/reporting/reports/deleteReportRequest") + @RequestMapping("/module/reporting/reports/deleteReportRequest.form") public String deleteReportRequest(@RequestParam("uuid") String uuid, @RequestParam(value="returnUrl", required=false) String returnUrl) { ReportService rs = Context.getService(ReportService.class); @@ -123,7 +132,7 @@ public String deleteReportRequest(@RequestParam("uuid") String uuid, return "redirect:" + ObjectUtil.nvlStr(returnUrl, "reportHistory.form"); } - @RequestMapping("/module/reporting/reports/loadReportStatus") + @RequestMapping("/module/reporting/reports/loadReportStatus.form") public String loadReportStatus(ModelMap model, @RequestParam("uuid") String uuid) { ReportService rs = Context.getService(ReportService.class); @@ -148,14 +157,14 @@ public String loadReportStatus(ModelMap model, @RequestParam("uuid") String uuid return "/module/reporting/json"; } - @RequestMapping("/module/reporting/reports/viewErrorDetails") + @RequestMapping("/module/reporting/reports/viewErrorDetails.form") public void viewErrorDetails(HttpServletResponse response, @RequestParam("uuid") String uuid) throws IOException { ReportRequest rr = Context.getService(ReportService.class).getReportRequestByUuid(uuid); String error = Context.getService(ReportService.class).loadReportError(rr); response.getWriter().write(error); } - @RequestMapping("/module/reporting/reports/reportHistorySave") + @RequestMapping("/module/reporting/reports/reportHistorySave.form") public String saveHistoryElement(@RequestParam("uuid") String uuid, @RequestParam(value="description", required=false) String description) { ReportService rs = Context.getService(ReportService.class); ReportRequest rr = rs.getReportRequestByUuid(uuid); @@ -164,7 +173,7 @@ public String saveHistoryElement(@RequestParam("uuid") String uuid, @RequestPara return "redirect:/module/reporting/reports/reportHistoryOpen.form?uuid="+uuid; } - @RequestMapping("/module/reporting/reports/reportHistoryOpen") + @RequestMapping("/module/reporting/reports/reportHistoryOpen.form") public String openFromHistory(@RequestParam("uuid") String uuid, HttpServletResponse response, WebRequest request, ModelMap model) throws IOException { ReportService rs = Context.getService(ReportService.class); ReportRequest req = rs.getReportRequestByUuid(uuid); @@ -205,7 +214,7 @@ public String openFromHistory(@RequestParam("uuid") String uuid, HttpServletResp return "/module/reporting/reports/reportHistoryOpen"; } - @RequestMapping("/module/reporting/reports/viewReport") + @RequestMapping("/module/reporting/reports/viewReport.form") public ModelAndView viewReport(@RequestParam("uuid") String uuid, HttpServletResponse response, HttpServletRequest request) throws IOException { ReportRequest req = getReportService().getReportRequestByUuid(uuid); RenderingMode rm = req.getRenderingMode(); @@ -243,7 +252,7 @@ public ModelAndView viewReport(@RequestParam("uuid") String uuid, HttpServletRes } - @RequestMapping("/module/reporting/reports/reportHistoryProcess") + @RequestMapping("/module/reporting/reports/reportHistoryProcess.form") public String runOnDemandPostProcessor(@RequestParam("uuid") String requestUuid, @RequestParam("processorUuid") String processorUuid, HttpServletResponse response, HttpServletRequest request) throws IOException { ReportRequest req = getReportService().getReportRequestByUuid(requestUuid); ReportProcessorConfiguration rpc = getReportService().getReportProcessorConfigurationByUuid(processorUuid); diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportRequestPortletController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportRequestPortletController.java index b4edcb377f..f88886458c 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportRequestPortletController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/ReportRequestPortletController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportFormController.java index a885f0d054..012b7a1d5c 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportListController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportListController.java index 4d580a838e..c9d1aaab7b 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportListController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/RunReportListController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/DelimitedTextReportRendererFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/DelimitedTextReportRendererFormController.java index 0b78b83efd..e2b6580652 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/DelimitedTextReportRendererFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/DelimitedTextReportRendererFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports.renderers; @@ -51,7 +47,7 @@ public DelimitedTextReportRendererFormController() { } /** * prepares a new form for the a DelimitedReportRenderer */ - @RequestMapping("/module/reporting/reports/renderers/delimitedTextReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/delimitedTextReportRenderer.form") public void delimitedTextReportRenderer(ModelMap model, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @RequestParam(required=false, value="reportDefinitionUuid") String reportDefinitionUuid, @@ -99,7 +95,7 @@ else if (successUrl.startsWith(pathToRemove)) { * @throws IllegalAccessException * @throws InstantiationException */ - @RequestMapping("/module/reporting/reports/renderers/saveDelimitedTextReportDesign") + @RequestMapping("/module/reporting/reports/renderers/saveDelimitedTextReportDesign.form") public String saveDelimitedTextReportDesign(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/ExcelReportRendererFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/ExcelReportRendererFormController.java index 4514fad4a5..1bd867229e 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/ExcelReportRendererFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/ExcelReportRendererFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports.renderers; @@ -61,7 +57,7 @@ public ExcelReportRendererFormController() { } /** * prepares a new form for the Excel report renderers */ - @RequestMapping("/module/reporting/reports/renderers/excelReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/excelReportRenderer.form") public void excelReportRenderer(ModelMap model, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @RequestParam(required=false, value="reportDefinitionUuid") String reportDefinitionUuid, @@ -114,7 +110,7 @@ else if (successUrl.startsWith(pathToRemove)) { * @throws InstantiationException */ @SuppressWarnings("unchecked") - @RequestMapping("/module/reporting/reports/renderers/saveExcelReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/saveExcelReportRenderer.form") public String saveExcelReportRenderer(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/NonConfigurableReportRendererFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/NonConfigurableReportRendererFormController.java index ab1fa3029f..ffea5c5af0 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/NonConfigurableReportRendererFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/NonConfigurableReportRendererFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports.renderers; @@ -46,7 +42,7 @@ public NonConfigurableReportRendererFormController() { } /** * prepares a new form for the a IndicatorReportRenderer */ - @RequestMapping("/module/reporting/reports/renderers/nonConfigurableReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/nonConfigurableReportRenderer.form") public void nonConfigurableReportRenderer(ModelMap model, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @RequestParam(required=false, value="reportDefinitionUuid") String reportDefinitionUuid, @@ -82,7 +78,7 @@ else if (successUrl.startsWith(pathToRemove)) { /** * Saves report design */ - @RequestMapping("/module/reporting/reports/renderers/saveNonConfigurableReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/saveNonConfigurableReportRenderer.form") public String saveNonConfigurableReportRenderer(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/TextTemplateFormController.java b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/TextTemplateFormController.java index 33015edd53..3c35d4d8b6 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/TextTemplateFormController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/reports/renderers/TextTemplateFormController.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.reports.renderers; @@ -83,7 +79,7 @@ public void initBinder(WebDataBinder binder) { * prepares a new form for the a TextTemplateRenderer * @throws UnsupportedEncodingException */ - @RequestMapping("/module/reporting/reports/renderers/textTemplateReportRenderer") + @RequestMapping("/module/reporting/reports/renderers/textTemplateReportRenderer.form") public void textTemplateReportRenderer(ModelMap model, @RequestParam(required=false, value="reportDesignUuid") String reportDesignUuid, @RequestParam(required=false, value="reportDefinitionUuid") String reportDefinitionUuid, @@ -128,7 +124,7 @@ else if (successUrl.startsWith(pathToRemove)) { * Saves report design * @throws UnsupportedEncodingException */ - @RequestMapping("/module/reporting/reports/renderers/saveTextTemplateReportRendererDesign") + @RequestMapping("/module/reporting/reports/renderers/saveTextTemplateReportRendererDesign.form") public String saveTextTemplateReportRendererDesign(ModelMap model, HttpServletRequest request, @RequestParam(required=false, value="uuid") String uuid, @RequestParam(required=true, value="name") String name, @@ -207,7 +203,7 @@ public UserParams userParams ( @RequestParam(required=false, value="userEnteredP return userParams; } - @RequestMapping( value="/module/reporting/reports/renderers/previewTextTemplateReportRenderer", method=RequestMethod.GET) + @RequestMapping( value="/module/reporting/reports/renderers/previewTextTemplateReportRenderer.form", method=RequestMethod.GET) public void initPreviewForm(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="reportDefinition") String reportDefinitionUuid, @RequestParam(required=false, value="uuid") String uuid, @@ -261,7 +257,7 @@ public void initPreviewForm(ModelMap model, HttpServletRequest request, } @SuppressWarnings("unchecked") - @RequestMapping(value="/module/reporting/reports/renderers/previewTextTemplateReportRenderer", method=RequestMethod.POST) + @RequestMapping(value="/module/reporting/reports/renderers/previewTextTemplateReportRenderer.form", method=RequestMethod.POST) public void previewScript(ModelMap model, HttpServletRequest request, @RequestParam(required=true, value="reportDefinition") String reportDefinitionUuid, @RequestParam(required=true, value="uuid") String uuid, diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DataSetTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DataSetTag.java index 9504c8ac0f..3fe16a8244 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DataSetTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DataSetTag.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.taglib; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DisplayLabelTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DisplayLabelTag.java index 9411d3b5a4..2fe70a22ed 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DisplayLabelTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/DisplayLabelTag.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.taglib; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/ForEachTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/ForEachTag.java index 6bce50d236..00309c293f 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/ForEachTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/ForEachTag.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.taglib; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java index 917bb925a3..8e1be720db 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/FormatTag.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.taglib; import java.io.IOException; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/Functions.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/Functions.java index ee7ab9424a..209edfb8fb 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/Functions.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/Functions.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.taglib; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/TimespanTag.java b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/TimespanTag.java index c130fe14f9..fbe27c8f88 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/taglib/TimespanTag.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/taglib/TimespanTag.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.taglib; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/util/AjaxUtil.java b/omod/src/main/java/org/openmrs/module/reporting/web/util/AjaxUtil.java index 1bef1085e5..1bf89f4c6a 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/util/AjaxUtil.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/util/AjaxUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.util; import java.io.StringWriter; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/util/ParameterUtil.java b/omod/src/main/java/org/openmrs/module/reporting/web/util/ParameterUtil.java index ef1ee48fd5..57e0ecfb2d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/util/ParameterUtil.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/util/ParameterUtil.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.util; import java.util.ArrayList; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/validator/IndicatorFormValidator.java b/omod/src/main/java/org/openmrs/module/reporting/web/validator/IndicatorFormValidator.java index 7a38a5f049..a3001b6d09 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/validator/IndicatorFormValidator.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/validator/IndicatorFormValidator.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.validator; import java.util.List; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/AjaxController.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/AjaxController.java index 7171720aa4..3273ec8f22 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/AjaxController.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/AjaxController.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.widget; import java.lang.reflect.Field; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CalculationRegistrationHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CalculationRegistrationHandler.java index 8960bad0f0..f61c9f258d 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CalculationRegistrationHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CalculationRegistrationHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortDefinitionHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortDefinitionHandler.java index d34dff01a1..48a013a1c3 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortDefinitionHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortDefinitionHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortIndicatorHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortIndicatorHandler.java new file mode 100644 index 0000000000..84133e0578 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/CohortIndicatorHandler.java @@ -0,0 +1,44 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ +package org.openmrs.module.reporting.web.widget.handler; + +import java.util.List; + +import org.openmrs.annotation.Handler; +import org.openmrs.api.context.Context; +import org.openmrs.module.htmlwidgets.web.WidgetConfig; +import org.openmrs.module.htmlwidgets.web.html.CodedWidget; +import org.openmrs.module.htmlwidgets.web.html.Option; +import org.openmrs.module.reporting.indicator.CohortIndicator; +import org.openmrs.module.reporting.indicator.Indicator; +import org.openmrs.module.reporting.indicator.service.IndicatorService; + +@Handler(supports = { CohortIndicator.class }, order = 25) +public class CohortIndicatorHandler extends IndicatorHandler { + + /** + * @see IndicatorHandler#populateOptions(WidgetConfig, CodedWidget) + */ + @Override + public void populateOptions(WidgetConfig config, CodedWidget widget) { + List listOfAllIndicators = null; + String tag = config.getAttributeValue("tag", null); + if (tag != null) { + listOfAllIndicators = Context.getService(IndicatorService.class).getDefinitionsByTag(tag); + } else { + listOfAllIndicators = Context.getService(IndicatorService.class).getAllDefinitions(false); + } + for (Indicator indicator : listOfAllIndicators) { + if (indicator instanceof CohortIndicator) { + widget.addOption(new Option(indicator.getUuid(), indicator.getName(), null, indicator), config); + } + } + } +} diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DataSetDefinitionHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DataSetDefinitionHandler.java index 0e62268c20..22a16113ff 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DataSetDefinitionHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DataSetDefinitionHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DimensionHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DimensionHandler.java index 7861c50105..f0a4e87732 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DimensionHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/DimensionHandler.java @@ -1,3 +1,12 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. + * + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. + */ package org.openmrs.module.reporting.web.widget.handler; import org.openmrs.annotation.Handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/IndicatorHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/IndicatorHandler.java index d27f70be60..5bf7e66559 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/IndicatorHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/IndicatorHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/MappedHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/MappedHandler.java index 88f6ada939..7d6b2ee957 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/MappedHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/MappedHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/PatientDataDefinitionHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/PatientDataDefinitionHandler.java index a6edd091b5..714a7cb470 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/PatientDataDefinitionHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/PatientDataDefinitionHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDefinitionHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDefinitionHandler.java index 4743977e75..65aee1fed2 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDefinitionHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDefinitionHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignRendererHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignRendererHandler.java index 1c9dedc2fe..2974448c23 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignRendererHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignRendererHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignResourceHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignResourceHandler.java index d77e4df20d..9367303ae6 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignResourceHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ReportDesignResourceHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ScriptingLanguageHandler.java b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ScriptingLanguageHandler.java index 5ce7eb3746..1b96308566 100644 --- a/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ScriptingLanguageHandler.java +++ b/omod/src/main/java/org/openmrs/module/reporting/web/widget/handler/ScriptingLanguageHandler.java @@ -1,15 +1,11 @@ /** - * The contents of this file are subject to the OpenMRS Public License - * Version 1.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * http://license.openmrs.org + * This Source Code Form is subject to the terms of the Mozilla Public License, + * v. 2.0. If a copy of the MPL was not distributed with this file, You can + * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under + * the terms of the Healthcare Disclaimer located at http://openmrs.org/license. * - * Software distributed under the License is distributed on an "AS IS" - * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - * License for the specific language governing rights and limitations - * under the License. - * - * Copyright (C) OpenMRS, LLC. All Rights Reserved. + * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS + * graphic logo is a trademark of OpenMRS Inc. */ package org.openmrs.module.reporting.web.widget.handler; diff --git a/omod/src/main/resources/config.xml b/omod/src/main/resources/config.xml index e4fca0c2c9..fe403b3391 100644 --- a/omod/src/main/resources/config.xml +++ b/omod/src/main/resources/config.xml @@ -15,7 +15,7 @@ @MODULE_PACKAGE@.ReportingModuleActivator https://dev.openmrs.org/modules/download/@MODULE_ID@/update.rdf - 1.11.3 - 1.11.*, 1.10.2 - 1.10.*, 1.9.9 - 1.9.*, 1.12 + ${openMRSVersion} org.openmrs.module.serialization.xstream @@ -25,8 +25,8 @@ - org.openmrs.module.reportingcompatibility org.openmrs.module.legacyui + org.openmrs.module.logic @@ -147,6 +147,16 @@ false If false, will disable the built in use of the evaluation logger to log evaluation information for performance diagnostics + + reporting.loadReportsFromConfigurationAtStartup + false + If true, this will automatically load reports defined by report descriptors in .OpenMRS/configuration/reports/reportdescriptors at startup + + + reporting.serializer.whitelist.types + org.openmrs.module.reporting.** + White-list of classes that are allowed for deserialization by the reporting module + @@ -168,15 +178,5 @@ ReportRequest.hbm.xml - - - /lib/reporting-api-1.9.* - 1.9.9 - 1.12.* - - - /lib/reporting-api-2.0.* - 2.* - - - + diff --git a/omod/src/main/resources/webModuleApplicationContext.xml b/omod/src/main/resources/webModuleApplicationContext.xml index acea8c95b8..26c9f4cb77 100644 --- a/omod/src/main/resources/webModuleApplicationContext.xml +++ b/omod/src/main/resources/webModuleApplicationContext.xml @@ -12,7 +12,6 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> - diff --git a/omod/src/main/webapp/cohorts/cohortDefinitionEditor.jsp b/omod/src/main/webapp/cohorts/cohortDefinitionEditor.jsp index 202eb61abf..7f6fa3e8e7 100644 --- a/omod/src/main/webapp/cohorts/cohortDefinitionEditor.jsp +++ b/omod/src/main/webapp/cohorts/cohortDefinitionEditor.jsp @@ -92,7 +92,7 @@ - + diff --git a/omod/src/main/webapp/datasets/datasetEditor.jsp b/omod/src/main/webapp/datasets/datasetEditor.jsp index c71709a402..f48a59ea07 100644 --- a/omod/src/main/webapp/datasets/datasetEditor.jsp +++ b/omod/src/main/webapp/datasets/datasetEditor.jsp @@ -3,8 +3,7 @@

@@ -134,7 +163,22 @@ - + + + + +
+
+ +
+
+ +
+
+
+
+ +
diff --git a/omod/src/main/webapp/datasets/iterableSqlDataSetEditor.jsp b/omod/src/main/webapp/datasets/iterableSqlDataSetEditor.jsp new file mode 100644 index 0000000000..4175a14eef --- /dev/null +++ b/omod/src/main/webapp/datasets/iterableSqlDataSetEditor.jsp @@ -0,0 +1,121 @@ +<%@ include file="/WEB-INF/template/include.jsp"%> + +<%@ include file="../manage/localHeader.jsp"%> + + + + + + + + + + + +
+
+ + + + +
+ +
+ +
+ + + + + + + + + +
+ + + + + + + +
+ +
+
+ + +
+ + "/> + " + onClick="window.location='${pageContext.request.contextPath}/module/reporting/definition/manageDefinitions.form?type=org.openmrs.module.reporting.dataset.definition.DataSetDefinition';"/> + + + + +
+
+
+
+ +
+
+ +
+ +
+ + +<%@ include file="/WEB-INF/template/footer.jsp" %> diff --git a/omod/src/main/webapp/definition/editAnnotatedDefinition.jsp b/omod/src/main/webapp/definition/editAnnotatedDefinition.jsp index 3af756d877..7f3e96cfe2 100644 --- a/omod/src/main/webapp/definition/editAnnotatedDefinition.jsp +++ b/omod/src/main/webapp/definition/editAnnotatedDefinition.jsp @@ -90,7 +90,7 @@ - + diff --git a/omod/src/main/webapp/definition/manageDefinitions.jsp b/omod/src/main/webapp/definition/manageDefinitions.jsp index 766b04d630..cadcad7be8 100644 --- a/omod/src/main/webapp/definition/manageDefinitions.jsp +++ b/omod/src/main/webapp/definition/manageDefinitions.jsp @@ -50,8 +50,8 @@ $j('#typeRowAll').css('background-color', '#E6E6E6'); }); - function confirmDelete(name, uuid, type) { - if (confirm("Are you sure you want to delete " + name + "?")) { + function confirmDelete(uuid, type) { + if (confirm("Are you sure you want to delete it?")) { document.location.href = 'purgeDefinition.form?uuid='+uuid+'&type='+type; } } @@ -115,10 +115,10 @@ - ${definition.name} + - ${definition.creator} + @@ -127,7 +127,7 @@     - +   diff --git a/omod/src/main/webapp/indicators/manageDimensions.jsp b/omod/src/main/webapp/indicators/manageDimensions.jsp index 272b8e81d9..45f5b9464a 100644 --- a/omod/src/main/webapp/indicators/manageDimensions.jsp +++ b/omod/src/main/webapp/indicators/manageDimensions.jsp @@ -59,11 +59,13 @@ - ${dimension.name} + - ${dimension.description} + + + diff --git a/omod/src/main/webapp/indicators/manageIndicators.jsp b/omod/src/main/webapp/indicators/manageIndicators.jsp index 41fc843c9f..9c015b7b1d 100644 --- a/omod/src/main/webapp/indicators/manageIndicators.jsp +++ b/omod/src/main/webapp/indicators/manageIndicators.jsp @@ -20,8 +20,8 @@ $j("#indicatorNameColumn").click(); } ); - function confirmDelete(name, uuid) { - if (confirm("Are you sure you want to delete " + name + "?")) { + function confirmDelete(uuid) { + if (confirm("Are you sure you want to delete it?")) { document.location.href = '${pageContext.request.contextPath}/module/reporting/indicators/purgeIndicator.form?uuid=' + uuid; } } @@ -97,7 +97,7 @@ - + @@ -106,7 +106,7 @@ - ${indicator.name} + @@ -132,7 +132,7 @@ period indicator - ${indicator.name} + ${indicator.creator} diff --git a/omod/src/main/webapp/portlets/baseCohortIndicator.jsp b/omod/src/main/webapp/portlets/baseCohortIndicator.jsp index 0344437f89..f467cf1351 100644 --- a/omod/src/main/webapp/portlets/baseCohortIndicator.jsp +++ b/omod/src/main/webapp/portlets/baseCohortIndicator.jsp @@ -63,11 +63,11 @@
- +
- +
@@ -124,10 +124,10 @@
- :  ${model.indicator.name} + :  
- :  ${model.indicator.description} + :  
:  ${model.indicator.type} diff --git a/omod/src/main/webapp/portlets/parameter.jsp b/omod/src/main/webapp/portlets/parameter.jsp index 7766118761..84198e0f86 100644 --- a/omod/src/main/webapp/portlets/parameter.jsp +++ b/omod/src/main/webapp/portlets/parameter.jsp @@ -135,15 +135,19 @@ - ${p.name} - ${p.label} + + + + + + - ${p.collectionType.simpleName}<${p.type.simpleName}> + < >; - ${p.type.simpleName} + diff --git a/omod/src/main/webapp/reports/manageReportDesigns.jsp b/omod/src/main/webapp/reports/manageReportDesigns.jsp index d7c676c528..35f172cd8b 100644 --- a/omod/src/main/webapp/reports/manageReportDesigns.jsp +++ b/omod/src/main/webapp/reports/manageReportDesigns.jsp @@ -20,7 +20,11 @@ document.location.href = '${pageContext.request.contextPath}/module/reporting/reports/renderers/editReportDesign.form?type=${design.rendererType.name}&reportDesignUuid=${design.uuid}'; }); $j('#${design.uuid}DesignRemoveLink').click(function(event){ - if (confirm('Please confirm you wish to permanantly delete ${design.name}')) { + var encodedStr = ""; + var parser = new DOMParser; + var dom = parser.parseFromString('' + encodedStr,'text/html'); + var decodedString = dom.body.textContent; + if (confirm('Please confirm you wish to permanantly delete '+decodedString)) { document.location.href='${pageContext.request.contextPath}/module/reporting/reports/deleteReportDesign.form?uuid=${design.uuid}'; } }); @@ -31,7 +35,10 @@ } ); $j('#designAddLink').click(function(event){ - document.location.href = '${pageContext.request.contextPath}/module/reporting/reports/renderers/editReportDesign.form?type=' + $j( this ).attr( 'href' ); + if($j("#rendererType").val()==="") + alert("Please select a value from Dropdown"); + else + document.location.href = '${pageContext.request.contextPath}/module/reporting/reports/renderers/editReportDesign.form?type=' + $j( this ).attr( 'href' ); }); }); @@ -57,9 +64,9 @@ - ${design.name} + - ${design.description} + ${design.reportDefinition.name} diff --git a/pom.xml b/pom.xml index 3cf11d8e76..bcb3f32832 100644 --- a/pom.xml +++ b/pom.xml @@ -1,62 +1,58 @@ + 4.0.0 org.openmrs.module reporting - 1.16.0-SNAPSHOT + 2.2.0-SNAPSHOT pom Reporting Parent project for Reporting http://openmrs.org - + scm:git:git@github.com:openmrs/openmrs-module-reporting.git scm:git:git@github.com:openmrs/openmrs-module-reporting.git https://github.com/openmrs/openmrs-module-reporting/ HEAD - + openmrs-repo-modules OpenMRS Modules - http://mavenrepo.openmrs.org/nexus/content/repositories/modules + https://openmrs.jfrog.io/artifactory/modules openmrs-repo-snapshots OpenMRS Snapshots - http://mavenrepo.openmrs.org/nexus/content/repositories/snapshots + https://openmrs.jfrog.io/artifactory/snapshots api - api-1.9 - api-2.0 api-tests omod - 1.9.9 - 1.9 - 1.7.2 - 0.2.12 + 2.7.0 + 2.7 + 2.0.1 + 0.3.0 1.2 - 1.5.0 2.1.1 3.12 - 1.8.7 - 2.3 - 1.1.2 - 1.2 + 2.12.5 + 1.1.2 + 1.7.0 UTF-8 ${project.parent.artifactId} Reporting ${project.parent.version} ${project.parent.groupId}.${project.parent.artifactId} - reporting-api-1.9 @@ -102,28 +98,6 @@ - - org.codehaus.jackson - jackson-core-asl - ${jacksonVersion} - provided - - - - org.codehaus.jackson - jackson-mapper-asl - ${jacksonVersion} - provided - - - - org.codehaus.groovy - groovy-all - ${groovyVersion} - jar - provided - - joda-time joda-time @@ -223,27 +197,6 @@ ${serializationVersion} provided - - - org.openmrs.module - serialization.xstream-api-1.9 - ${serializationVersion} - provided - - - - org.openmrs.module - serialization.xstream-api-1.10 - ${serializationVersion} - provided - - - - org.openmrs.module - serialization.xstream-api-2.0 - ${serializationVersion} - provided - org.openmrs.module @@ -258,7 +211,7 @@ ${htmlwidgetsVersion} provided - + javax.mail mail @@ -274,6 +227,31 @@ provided + + org.owasp.encoder + encoder + 1.2.3 + + + + + com.fasterxml.jackson.core + jackson-core + 2.9.8 + provided + + + com.fasterxml.jackson.core + jackson-databind + 2.9.10.8 + provided + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + 2.9.8 + + org.apache.poi poi-ooxml @@ -295,49 +273,6 @@ - - - 1.10 - - 1.10.2 - 1.10 - - - - 1.11 - - 1.11.3 - 1.11 - - - - 1.12 - - 1.12.0 - 1.12 - 1.9.13 - - - - 2.0 - - 2.0.0 - 2.0 - 1.9.13 - reporting-api-2.0 - - - - 2.1 - - 2.1.0 - 2.1 - 1.9.13 - reporting-api-2.0 - - - - @@ -394,6 +329,10 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + @@ -402,8 +341,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 1.8 + 1.8 @@ -418,10 +357,10 @@ org.apache.maven.plugins maven-surefire-plugin - 2.5 + 3.5.3 - -Xmx1024m -Xms1024m -XX:MaxPermSize=512m -Duser.language=en -Duser.region=US + -Xmx1024m -Xms1024m -Duser.language=en -Duser.region=US -Djdk.net.URLClassPath.disableClassPathURLCheck=true ${java.io.tmpdir} @@ -458,7 +397,18 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.11.2 + + -Xdoclint:none + + + + attach-javadocs + + jar + + + @@ -547,7 +497,7 @@ openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://openmrs.jfrog.io/artifactory/public @@ -555,7 +505,7 @@ openmrs-repo OpenMRS Nexus Repository - http://mavenrepo.openmrs.org/nexus/content/repositories/public + https://openmrs.jfrog.io/artifactory/public false