muliann / dslapi

DSL API End points

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MOH DAP API Layer.

Table of Contents
  1. About The Project
  2. Getting Started
  3. License

About The Project

DAP API Endpoints provides RESTful access to the integrated health data in the Data Analytics Platform Warehouse. The endpoints are organised around the different available data sources and the data mining funtionalities.

Getting Started

This is a java project built using the maven tool( follow for maven overview ).

Prerequisites

  • Install JDK (jdk1.8+ - Oracle jdk1.8, Open jdk1.8).

  • Install maven V3.6.3+ Maven

  • Some unit tests in the project depend on the dslminer project to complete. Please see the project set up docs to run it before building your DAP API sources. Edit the file dslapi/dsl_service_parent_project/dsl_api_implementation/src/main/resources/settings.properties to set up the current host and port of the DAP miner app to allow unit tests to run against those APIs during the DAP API build process.

  • The project uses the ehcache library for cacheing. If in the course of development you get the following error:

   unknow request net.sf.ehcache.config.InvalidConfigurationException: There is one error in your configuration: 
	 CacheManager configuration: 

This is as a result of your web server having less memory than you allocated in the cache configuration file. In this case edit the following file dslapi/dsl_service_parent_project/dsl_api_implementation/src/main/resources/ehcache.xml to configure memory space in line with your webserver allocated memory space by the JDK. eg.

  <?xml version="1.0" encoding="UTF-8"?>

  <ehcache
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true"
      monitoring="autodetect" dynamicConfig="true">

      <cache name="dslCache"
             maxEntriesLocalHeap="2"
             maxEntriesLocalDisk="1"
             eternal="true"
             diskSpoolBufferSizeMB="6"
             timeToIdleSeconds="0" timeToLiveSeconds="0"
             memoryStoreEvictionPolicy="LFU"
             transactionalMode="off">
          <persistence strategy="localTempSwap" />
      </cache>

  </ehcache>

Installation

  1. Clone the repo
    git clone https://github.com/uonafya/dslapi.git
  2. Set up database connetion to the MoH DAP Warehouse by editing the following file in the project:
     dslapi/dsl_service_parent_project/dsl_api_implementation/src/main/resources/database.properties 
  3. Change directory.
    cd dslapi
  4. Compile the package
    mvn package

Compiled war file is placed in the target directory of the dslapi module which can be deployed to your webserver, currently tested on Apache Tomcat.

Test unit & API documentation

The project uses Spring rest docs to auto generate the documentation of the APIs. They leverage on unit tests to test the APIs and document both request and responses, see here unit tests in: dslapi/dsl_api/src/test/java/com/healthit/dslservice/docs/. The Documentation uses asciidoc markup format as a template for the request and response test done in the unit tests. Access template format dslapi/dsl_api/src/docs/api-guide.adoc

Documentation

http://dsl.health.go.ke/dsl/api/

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

About

DSL API End points

License:GNU General Public License v3.0


Languages

Language:Java 99.9%Language:HTML 0.1%