Architecture

The technical architecture of OpenCRVS was designed to conform to the Open Health Information Exchange (OpenHIE) architectural standardarrow-up-right and interoperate using HL7 (Fast Healthcare Interoperability Resources) or FHIRarrow-up-right. FHIR is a global standard application programming interface or (API) for exchanging electronic health records.

By following the OpenHIE framework, OpenCRVS seamlessly connects civil registration to health services and other systems. Firstly, by utilising the OpenHIE interoperability reference middleware OpenHIMarrow-up-right, a FHIR standard enterprise service bus; and secondly, by using a scalable, modular, NoSQL FHIR datastore, called Heartharrow-up-right.

We use OpenHIM to receive birth and death notifications from a hospital setting, and expose registration events to any other technical system via an API gateway e.g. MOSIP foundational national IDarrow-up-right, or DHIS2 health Information Managementarrow-up-right.

OpenCRVS business functions are designed using modular, event-driven microservicesarrow-up-right. Each micro service and every OpenCRVS component is independently scalable in private or public cloud, in large or small data centres, and easy to manage, load balance and network using included Docker Swarmarrow-up-right configurations.

OpenCRVS builds on these sound principles by additionally providing:

OpenCRVS is a full-stack that is designed to give you the lowest possible "total cost of ownership"arrow-up-right.

Our international development teams work in an Agile way, in tandem with local development resources and human-centred designers, following the Scrumarrow-up-right methodology, to rapidly design, build, deploy, test and maintain OpenCRVS releases.

Open source dependencies

The following dependencies are automatically provisioned alongside the OpenCRVS Core in dockerarrow-up-right containers in a Docker Swarm on Ubuntu.

Docker Swarm

Docker Swarmarrow-up-right was chosen by our architects in 2018 for it's lack of requirement of other essential dependencies, it's close alignment with Docker and it's simplicity in terms of installation and monitoring on a Tier 2 private data centrearrow-up-right, on bare metal servers with headless Ubuntu OSarrow-up-right. Why not use AWS, public cloud SaaS or serverless you might be thinking?

  • Many countries may be located far from a high-quality data-centre above Tier 2.

  • Many countries may not legally support international data storage of citizen data on a public cloud. Getting the legal approval for external storage of citizen data requires regulatory change which can take a considerable amount of time.

  • Because some countries may not be able to maintain complex software independently, we are considering a SaaS solution, provided enough countries get regulatory approval. Over time, this situation appears to be slowly evolving and we are monitoring it closely.

Previously unskilled system administrators can quickly up-skill in the techniques of private cloud infrastructure management using Docker Swarm. We wanted to democratise containerisation benefits for all countries.

Is there a plan for Kubernetes?

We are working on a Kubernetesarrow-up-right migration now that Kubernetes has become a more mature, easier to use and configure solution, thanks to dependencies like Helm and other plugins increasing popularity since 2018. In the meantime, Docker Swarm makes it easy to commence containerised microservice package distribution privately, automatically configures a "round robin" load balanced cluster, and provides Service Discovery out-the-box.

Hearth MongoDB Database layer

In order to support configuration for limitless country scale, OpenCRVS was designed for NoSQLarrow-up-right, built on MongoDBarrow-up-right, and aligned to a globally recognised healthcare standard.

Massively scalable and extensible, Heartharrow-up-right is an OpenSource NoSQL database server originally built by the OpenCRVS founding member Jembi Health Systemsarrow-up-right, using interoperable Health Level 7arrow-up-right FHIRarrow-up-right v4 (ANSIarrow-up-right Accredited, Fast Healthcare Interoperability Resources) as standard.

We extended FHIRarrow-up-right to support the civil registration context. Our civil registration FHIR standard is described here.

ElasticSearch

OpenCRVS uses ElasticSearcharrow-up-right, an industry standard, NoSQL document orientated, real-time de-duplication & search engine. Lightning fast, intelligent civil registration record returns are possible, even with imprecise “fuzzy” search parameters.

De-duplication management to ensure data integrity is essential to any civil registration system. A fast search engine lowers operational costs and improves the user experience for frontline staff.

ElasticSearch is also used with Kibanaarrow-up-right for application and server health monitoring. \

InfluxData

The hyper-efficient Influxarrow-up-right "time series database" is used in our stack for "big data" performance insights. Millisecond level query times facilitate civil registration statistical queries over years of data, disaggregated by gender, location and configurable operational and statistical parameters. \

OpenHIM enterprise service bus, interoperability Layer

The OpenHIM (Health Information Mediator)arrow-up-right is a NodeJS enterprise service bus designed to ease interoperability between OpenCRVS and external systems such as Health & National ID. It provides external access to the system via secure APIs. OpenHIM channels and governs internal transactions, routing, orchestrating and translating requests into FHIRarrow-up-right between services and the database layer.

OpenCRVS packages

The core of OpenCRVS is a monorepo organised using Lernaarrow-up-right. Each package reports unit test coverage in Jestarrow-up-right. Following the microservicearrow-up-right, 1 service per container model, every package is independently scalable in a single dockerarrow-up-right container.

\

Microservice business layer packages

The OpenCRVS microservice architecture enables continuous evolution of its business requirements.

The microservices are written in TypeScriptarrow-up-right (a strictly typed superset of JavaScript that compiles to JavaScript) and NodeJS using the HapiJSarrow-up-right framework.

Each microservice in OpenCRVS has no knowledge of other services or business requirements in the application, and each exposes it’s capabilities via JWTarrow-up-right secured APIs.

Client application packages

Using an Android progressive web applicationarrow-up-right for our client applications means that we can take advantage of offline functionality and native mobile features using Workboxarrow-up-right, without the overhead of maintaining multiple web and mobile codebases and respective App/Play Store releases.

In remote areas, registrars can save a configurable number of registrations offline on their mobile phone, using IndexedDBarrow-up-right.

Client npmarrow-up-right dependencies and enablers include:

Support packages

Automated testing support

OpenCRVS Core displays Codecovarrow-up-right enforced 80% unit testing coverage on git. We supply example e2e UI test scripts using Cypressarrow-up-right and cover the main registration business functionality in those tests.

Because the OpenCRVS Form UI is configurable to your country, the end-to-end testing scripts are located in our example country configuration server for Farajalandarrow-up-right so you can copy this approach and customise them depending on the structure of your published form.

Last updated