Author: Craig Stancl, Scott Bauer, Kevin Peterson
Email: stancl.craig@mayo.edu, bauer.scott@mayo.edu, peterson.kevin@mayo.edu
Team: LexEVS
Contract: CBITT BOA Subcontract# ST121106
Client: NCI CBIIT
National Institutes of Heath
US Department of Health and Human Services
Revision History
Version | Date | Description of Changes | Author |
---|---|---|---|
1.0 | 2013/02/21 | Initial Version | --- |
CTS2 REST Services
1 Architecture Design
The CTS2 Development Framework is a development kit for rapidly creating CTS2 compliant applications. The Development Framework allows for users to create plugins which may be loaded into the Development Framework to provide REST Web Services that use CTS2 compliant paths and model objects. Because the Development Framework is plugin based, users are required only to implement the functionality that is exclusive to their environment. For example, in any REST service, a large portion of code must be written to accept HTTP requests, handle errors, accept parameters, etc. The Development Framework provides all of this infrastructure, as well as utilities to help create plugins. The developer then is left to create the implementation plugin, which is the code specific to the individual environment. For example, this code may retrieve data from a database, read data from a file system, aggregate two more other services, etc.
CTS2 is modeled abstractly (the Platform Independent Model or ‘PIM’) and for specific platforms (the Platform Specific Model or ‘PSM’). The CTS2 Development Framework attempts to transform these ideas into the MVC architecture style. Much like a traditional MVC implementation, multiple ‘Views’ expose the ‘Model’ with the help of the ‘Controller’. If we think of a ‘PSM’ as a ‘View’, and the CTS2 Development Framework acting as the ‘Controller’, a developer needs only to produce the ‘PIM’ based ‘Model’. Going further:
Model View Architecture (MVC)
Model
Transforms View (CTS2 PIM) structures into state (aka “backing store”)
Enforces post-conditions
May also enforce some invariants
View
Implements the static portion of the CTS2 model
(Indirectly) enforces some invariants
Controller
Implements the behavioral portion of the CTS2 model
Accepts events
Validates invariants
Enforces preconditions
1.1 Logical View
The CT2 Devleopment Framework (CTS2DF) is a Plugin-based Java toolkint. It is built on the OSGi framework, which allows it to adopt a modular architecture. At the center, the CTS2DF is a web application, capable of being deployed to a web application server such as Tomcat, Jetty, WebSphere, etc. At the core, the CTS2DF starts an Apache Felix OSGi environment. This allows the OSGi framework to be self-contained, eliminating the need for special application servers to be used.
After initialization, the CTS2DF will use Service Plugin Implementations (or OSGi bundles) to implement the CTS2 functionality. These Service Plugins conform to a standard CTS2 interface, and are intended to be implemented according to the requirements of the implementer or organization. Furthermore, additional (non-CTS2) plugins can be registered to the service to provided extra functionality, such as security or caching. An added benefit of these plugins is that they can be shared across CTS2 implementations. Ultimately, the CTS2DF process the results of calls to these Service Plugins and transforms the responses into CTS2 compliant XML, JSON, or HTML.
1.2 Software Architecture
1.2.1 High Level Structure
START
WHILE TRUE:
ACCEPT HTTP REQUEST
SERVICE_INTERFACE = ServiceProvider.getService() #Ask the ServiceProvider for an Implementation
IF SERVICE_INTERFACE == NULL
THEN: RETURN NOT_IMPLEMENTED_ERROR #If not found, assume CTS2 Service is not Implemented
ELSE: ServiceProvider.getService().call() #If matching implementation is found, execute it
END IF
END WHILE:
END
1.2.2 Basic Request Sequence
1.2.3 Independent Module Structure
1.2.3.1 CodeSystemReadService
1.2.3.2 CodeSystemQueryService
1.2.3.3 CodeSystemVersionReadService
1.2.3.4 CodeSystemVersionQueryService
1.2.3.5 EntityDescriptionReadService
1.2.3.6 EntityDescriptionQueryService
1.2.3.7 AssociationReadService
1.2.3.8 AssociationQueryService
1.2.3.9 MapReadService
1.2.3.10 MapQueryService
1.2.3.11 ValueSetReadService
1.2.3.12 ValueSetQueryService
1.2.3.13 ValueSetDefinitionReadService
1.2.3.14 ValueSetDefinitionQueryService
Glossary
Service Plugin - An OSGi bundle capable of being loaded into the CTS2 Development Framework. In order to be recognized as a Service Plugin, the bundle must export one (and only one) Service of type ServiceProvider. Note, however, that the bundle is no excluded from exporting other services – but it must at least export one and only one ServiceProvider Service.