CDCgov/SDP-CBR

Name: SDP-CBR

Owner: Centers for Disease Control and Prevention Surveillance Strategy

Description: null

Created: 2017-04-10 19:52:29.0

Updated: 2018-04-10 14:46:26.0

Pushed: 2018-05-21 14:44:29.0

Homepage: null

Size: 888

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Surveillance Data Platform Content Based Routing (SDP-CBR)

This Github organization was created for use by CDC programs to collaborate on public health surveillance related projects in support of the CDC Surveillance Strategy. This third party web application is not hosted by the CDC, but is used by CDC and its partners to share information and collaborate on software.

This repository serves as a template for other repositories to follow in order to provide the appropriate notices for users in regards to privacy protection, contribution, licensing, copyright, records management and collaboration.

Public Domain:

This project constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication. All contributions to this project will be released under the CC0 dedication. By submitting a pull request you are agreeing to comply with this waiver of copyright interest.

License

The project utilizes code licensed under the terms of the Apache Software License and therefore is licensed under ASL v2 or later.

This program is free software: you can redistribute it and/or modify it under the terms of the Apache Software License version 2, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software License for more details.

You should have received a copy of the Apache Software License along with this program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html

Privacy

This project contains only non-sensitive, publicly available data and information. All material and community participation is covered by the Surveillance Platform Disclaimer and Code of Conduct. For more information about CDC's privacy policy, please visit http://www.cdc.gov/privacy.html.

Contributing

Anyone is encouraged to contribute to the project by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.) By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Apache Software License v2 or later.

All comments, messages, pull requests, and other submissions received through CDC including this GitHub page are subject to the Presidential Records Act and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.

Records

This project is not a source of government records, but is a copy to increase collaboration and collaborative potential. All government records will be published through the CDC web site

Notices

Please refer to CDC's Template Repository for more information about contributing to this repository, public domain notices and disclaimers, and code of conduct.

Hat-tips

Thanks to 18F's open source policy and code of conduct that were very useful in setting up this GitHub organization. Thanks to CDC's Informatics Innovation Unit that was helpful in modeling the code of conduct.

SDP-CBR

This example demonstrates how to configure Camel routes in Spring Boot via a Spring XML configuration file.

The application utilizes the Spring @ImportResource annotation to load a Camel Context definition via a camel-context.xml file on the classpath.

Building

The application can be built with the following command

mvn clean package
Databases

The application depends on a number of databases and connections in order to run. All databases are defined in the application properties, which should be configured for the environment.

Required databases for deployment are the phinMsDataSource and sdpqDataSource. The phinMsDataSource should have the table message_inq, which can be created in SQLServer using the script at main/db/MSSQL_message_inq.sql. The other tables will be created as needed by the application.

Testing

The application unit tests can be run with the following command

mvn test

In order for the tests to succeed, the test datasources must be properly configured. All test datasources are specified in the test properties file at src/test/resources/application.properties. If any of the datasources are not configured, the tests will fail.

Required databases for tests are nndssDataSource, sdpqDataSource, and phinMsDataSource. The phinMsDataSource should have the table message_inq, which can be created in SQLServer using the script at main/db/MSSQL_message_inq.sql. The other tables will be created as needed by the application.

Running the application in OpenShift

The application is setup as a series of maven sub modules. The sub modules comprise both reusable components such as the database queue component as well as modules that comprise portions of the application that are meant to be run. The 2 modules that are meant to be run are the phinms and foodnet modules. You can run either of these on openshift with the following description provided the commands are executed from within the modules sub directory. It is assumed that:

The application can be built and run on OpenShift using a single goal:

mvn fabric8:deploy

To list all the running pods:

oc get pods

Then find the name of the pod that runs this quickstart, and output the logs from the running pods with:

oc logs <name of pod>

You can also use the OpenShift web console to manage the running pods, and view logs and much more.

Running via an S2I Application Template

Application templates allow you deploy applications to OpenShift by filling out a form in the OpenShift console that allows you to adjust deployment parameters. This template uses an S2I source build so that it handle building and deploying the application for you.

First, import the Fuse image streams:

oc create -f https://raw.githubusercontent.com/jboss-fuse/application-templates/GA/fis-image-streams.json

Then create the quickstart template:

oc create -f https://raw.githubusercontent.com/jboss-fuse/application-templates/GA/quickstarts/spring-boot-camel-xml-template.json

Now when you use “Add to Project” button in the OpenShift console, you should see a template for this quickstart.

The s2i templates will build the entire project and assumes that the resulting build will place the application in a single jar file in the top level target directory of the project. As this is not the case for this projects setup you will need to add an environment variable that will inform the s2i template where to look for the resulting jar file to run. The variable is ARTIFACT_DIRECTORY and it must be set to either phinms/target or foodNet/target depending on which route is being deployed.

Running the application locally

The maven command to build the application described above produces an all-in-one jar file that can be run locally for both the foodnet and phinms sub modules. The jar files are created in the target directory of the individual sub projects and can be run with the following commands.

 java -jar foodNet/target/sdp-cbr-foodnet-1.1.0.jar 
 java -jar phinms/target/sdp-cbr-phinms-1.1.0.jar 

When running locally the application can be configured through extenal properties files according as provided by the spring boot framework. Information on this external configuration can be found at the following location. https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-profile-specific-properties

The base properties for the application are contained in the src/main/resources/application.properties file. This file is basically a template for fields that will need to be filled out in order for the routes to run. Please review the file in order to understand the configuration parameters that are required.

Filtering on HL7 message contents

The HL7Terser is designed to allow for complex filter parameters to be defined via the routes in the camel-context.xml file. For more information on filter syntax, please review the syntax instruction in [Definitions.txt](Filter Definitions.txt).


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.