SlideShare a Scribd company logo
Building an OpenMRS
Distribution
Developer lessons from KenyaEMR
Distribution?
• Thinking in terms of “distributions” appears a
recent development in OpenMRS
• Nationwide implementations of OpenMRS are
becoming more common (e.g. Rwanda)
• Managing 100 sites is a
very different challenge
to managing 10 sites
Challenges of scale
• Need for consistency across site installations
• Need for simple or automated upgrades and
maintenance
• Need for scalable user support
Site inconsistency
• What we want to avoid:
Site

OpenMRS Concepts

Module 1

Module 2

Clinic 1

1.9.3

20140714 2.5.3

0.3

Clinic 2

1.9.3

20131215 2.4.1

1.0-BETA

Clinic 3

1.9.7

20131215 2.4

…

0.3.1

…

• Endless different environments, most of which
won’t have been tested
• Becomes impossible to manually track
Site inconsistency
• More chance of site-specific bugs
– Development team might not have tested a site’s
particular environment

• Complex site-specific upgrade processes
– Single components upgraded individually

• Confusion for users trained in different
environments
– National implementations often rely on
centralised training events
Site consistency
• A distribution should define a consistent
environment
• We can break that down into components:
– A version of OpenMRS core
– A set of modules with specified versions
– A set of metadata objects
• Might be versioned SQL dumps or MDS packages
• Might include a separately versioned concept
dictionary
Distribution example
• An implementation’s own custom modules
will only be a part of the larger distribution:
OpenMRS

MyModule
Reporting
MyDistro

Idgen
HtmlFormEntry

CIEL
Distribution versioning
• Specific versioned releases of all the components make
up a single versioned release of the distribution, e.g.
OpenMRS 1.9.3

OpenMRS 1.9.7

MyModule 1.0

MyModule 1.1

Reporting 0.8

Reporting 0.8.1
MyDistro 1.0

MyDistro 2.0

Idgen 2.6

Idgen 2.6

HtmlFormEntry 2.5

HtmlFormEntry 2.5.1

CIEL 20120931

CIEL 20140107
Distribution versioning
• At every stage of the development lifecycle,
we should be working with a version of the
complete distribution, e.g.
Development with an
“in-progress” version

mydistro-2.0-SNAPSHOT
mydistro-2.0-RC1

Testing with release
candidate versions
mydistro-2.0-RC2
Installations and upgrades
with released versions

mydistro-2.0
Distribution modules
• Rather than manage a distribution as a
separate project, it can be easier to tie it to a
“distribution module”
• Its version is the distribution version
• Defines the required versions of all other
components
• Depends on all of the other modules
Distribution modules
• By requiring all of
the other modules
the, distribution
module ensures
that the
distribution is
always run as a
whole

<require_modules>
<require_module version="0.8.1">
org.openmrs.module.reporting
</require_module>
<require_module version="2.6">
org.openmrs.module.idgen
</require_module>
<require_module version="2.5.1">
org.openmrs.module.htmlformentry
</require_module>
</require_modules>
Continuous integration
• Don’t want to develop different components
in insolation and only realise integration
problems during testing
• Developers should work with the latest
version of the distribution
• CI server should be used to
keep a testing server up to
date with changes to any component
Buildable distributions

mydistro-2.0-SNAPSHOT

mydistro-2.0-distro.zip

• Need to make it easy for developers (and CI
servers) to deploy a particular version of a
distribution
• Useful to have a zip archive of the different
component modules
mymodule-1.1.omod

reporting-0.8.1.omod
idgen-2.6.omod

htmlformentry-2.5.1.omod
Buildable distributions
• Maven provides a convenient mechanism to
produce an archive of a project with its
dependencies – called an assembly
• Thus our distribution module can have two
build outputs:
– A regular omod
– A distribution zip archive
For an example of how to implement this, see: https://github.com/ITECH/openmrs-module-kenyaemr/blob/master/distro
Metadata consistency
• The idea of site consistency should apply also
to metadata
• For example:
– The distribution does patient registration
– This saves encounters of type “Registration”
– The distribution can’t function if that encounter
type doesn’t exist
– Can we guarantee that the encounter type means
the same thing in different installations?
User managed metadata
• Non-distribution modules often expect the
user to manage metadata, e.g.
– Every time some code tries to access the
“Registration” encounter type, check for null
– If it doesn’t exist, show the user an error message
to tell them to create it
– Tell user to set the
mydistro.registrationEncounterType global
property to reference the new object
Distribution managed metadata
• If we want to be sure that metadata is the
same across all sites, we manage it via code
rather than users
• Distributions should install required metadata
automatically
• Distribution code should assume that the
metadata exists
– If it doesn’t, it is a developer problem rather than
a user problem
Fail fast assumptions
• If we assume that metadata always exists, we
should fail-fast if that assumption turns out to
be incorrect, e.g.
EncounterType ret = Context.getEncounterService().getEncounterTypeByUuid(uuid);
if (ret == null) {
throw new IllegalArgumentException("No such encounter type with uuid " + uuid);
}

• Helps developers find problems right away
• Easier than tracking down source of a NPE
The Metadata Deploy module provides fail-fast fetch methods for most
metadata classes: https://github.com/I-TECH/openmrs-module-metadatadeploy
Metadata identity
• Database ids are not reliable for identifying
the same metadata in different installations
• Anytime distribution code references
metadata it should use one of:
– UUID: all OpenMRS classes have these and they
can be kept consistent across installations
– Reference terms: these are globally consistent
and unique identifiers for concepts (and soon also
drugs)
Metadata installation
• One approach is to bundle metadata packages
with the distribution and install these on
startup
• Weaknesses of this approach:
– Metadata is not easily readable or editable
– Packages typically have to be managed on an
external server, exported and embedded into the
code
– Package installation is slow so usually not
appropriate to use the same packages in unit tests
Metadata deploy
• Module was developed to address these
issues
– Allows metadata to be defined in code
– Metadata is easy to read and edit
– Fast installation suitable for unit tests

For more information about the Metadata Deploy module go to
https://wiki.openmrs.org/display/docs/Metadata+Deploy+Module
Metadata deploy
• Metadata that’s too lengthy to be described in
code can be loaded from CSV files etc
– Still more readable than zip archives

• Support for synchronization of large sets
– Used to synchronize OpenMRS locations with all
9500 facilities in the Kenya Master Facility List:
• Clean database synchronization: 1min
• Subsequent synchronization: 3-4secs
• Previous MDS package load: 20-25mins
Concepts?
• So far SQL dumps have been best for these:
– We don’t manage/edit them directly (we use CIEL)
– Database dump is only quick way to install
50,000+ concepts

• Groovy script used used to generate XML
dataset file of just those concepts used by
KenyaEMR
– Used for unit tests that need access to same
concepts as production environment
Example metadata bundle
@Component
@Requires({ BaseMetadata.class })
public class MyMetadata extends AbstractMetadataBundle {

This “bundle” installs
an encounter type
and two forms

public static final class _EncounterType {
public static final String ENCOUNTER_TYPE1 = "d3e3d723-7458-4b4e-8998-408e8a551a84";
}
public static final class _Form {
public static final String FORM1 = "4b296dd0-f6be-4007-9eb8-d0fd4e94fb3a";
public static final String FORM2 = "89994550-9939-40f3-afa6-173bce445c79";
}
@Override
public void install() {
install(encounterType("Encounter Type #1", "Something...", _EncounterType.ENCOUNTER_TYPE1));
install(form("Form #1", null, _EncounterType.ENCOUNTER_TYPE1, "1", _Form.FORM1));
install(form("Form #2", null, _EncounterType.ENCOUNTER_TYPE1, "1", _Form.FORM2));
// A form that should be retired if it exists
uninstall(possible(Form.class, "73d34479-2f9e-4de3-a5e6-1f79a17459bb"), "Because...");
}
}

Also retires a form
that’s no longer needed
Enforcing consistency
• Current OpenMRS UI wasn’t made for this
idea of a distribution
• Ideally we want to prevent even the super
user account from doing things like:
– Stopping modules
– Deleting or modifying metadata

• KenyaEMR overrides the regular
UI and provides a custom UI
without this functionality
Installations and upgrades
• OpenMRS itself is usually only one part of a
functioning EMR installation
• Other parts might be:
– The database client and server
– The JVM
– Tomcat or another Java web app server
– Database backup scripts run by cron jobs
– Help and training materials
Installations and upgrades
• For small or single site implementations,
developers often do these
• Not feasible for large implementations:
– Developers can’t physically visit every site
– Sites often have connectivity issues
– Upgrades need to be performed by less technical
users
Installation via virtual machine
• Working installations require correct
configuration of all those parts
• Easier to configure once at the office than
100s of times at each site
• Can build virtual machine
images and clone for all sites
Installation via virtual machine
• Ongoing experiments with different ways of
retaining patient data during upgrade
– Moving data from old to new VM via SQL dump
– Separate VMs for database (not replaced) and
web app (replaced)

• Other experiments using bittorrent to
download VM images to sites
– Works even when connectivity is very poor
Maintenance
• Things inevitably go wrong, e.g.
– Sites could end up with invalid data due to a
software bug
– Might need to convert data as software changes

• Modules can provide liquibase files to make
one time changes
– Not always easy or possible to do something with
just SQL
Automated fixes
• Requiring user intervention should be a last
resort
• KenyaEMR provides its own automated way of
making fixes called chores:
– Java classes which perform a one-time job
– Run at the end of KenyaEMR startup so have
access to all metadata and services
See KenyaEMR source for examples of chore classes: https://github.com/ITECH/openmrs-modulekenyaemr/tree/master/api/src/main/java/org/openmrs/module/kenyaemr/chor
e
User support
• Need clear processes for issue tracking:
– More technical site staff can create support tickets
directly in ticketing system
– Less technical site staff can use email or phone
and then support staff will create ticket

• Help materials need to be
easily accessible to site users
User support
• KenyaEMR integrates
with external help site
• Users can lookup help
documents and videos
• Can provide context
sensitive help within
different apps
Help site code available at
https://github.com/I-TECH/helpsite
Bahati nzuri!

More Related Content

What's hot

Data mining & data warehousing (ppt)
Data mining & data warehousing (ppt)Data mining & data warehousing (ppt)
Data mining & data warehousing (ppt)
Harish Chand
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
James Serra
 
Big Data Ecosystem
Big Data EcosystemBig Data Ecosystem
Big Data Ecosystem
Lucian Neghina
 
3 pillars of big data : structured data, semi structured data and unstructure...
3 pillars of big data : structured data, semi structured data and unstructure...3 pillars of big data : structured data, semi structured data and unstructure...
3 pillars of big data : structured data, semi structured data and unstructure...
PROWEBSCRAPER
 
Chapter 1 big data
Chapter 1 big dataChapter 1 big data
Chapter 1 big data
Prof .Pragati Khade
 
data warehouse , data mart, etl
data warehouse , data mart, etldata warehouse , data mart, etl
data warehouse , data mart, etl
Aashish Rathod
 
Management Information System & Technology
Management Information System & TechnologyManagement Information System & Technology
Management Information System & Technology
Akash Jauhari
 
Data Warehouse
Data Warehouse Data Warehouse
Data Warehouse
MadhuriNigam1
 
NoSQL
NoSQLNoSQL
NoSQL
Radu Potop
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
Dung Nguyen
 
Classification of data
Classification of dataClassification of data
Classification of data
Dr. C.V. Suresh Babu
 
Introduction to Sharding
Introduction to ShardingIntroduction to Sharding
Introduction to Sharding
MongoDB
 
OLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSEOLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSE
Zalpa Rathod
 
Advanced Dimensional Modelling
Advanced Dimensional ModellingAdvanced Dimensional Modelling
Advanced Dimensional Modelling
Vincent Rainardi
 
Modern Metadata Strategies
Modern Metadata StrategiesModern Metadata Strategies
Modern Metadata Strategies
DATAVERSITY
 
Big data by Mithlesh sadh
Big data by Mithlesh sadhBig data by Mithlesh sadh
Big data by Mithlesh sadh
Mithlesh Sadh
 
Hadoop Architecture
Hadoop ArchitectureHadoop Architecture
Hadoop Architecture
Dr. C.V. Suresh Babu
 
Big data ecosystem
Big data ecosystemBig data ecosystem
Big data ecosystem
magda3695
 
Database security
Database securityDatabase security
Database security
Arpana shree
 
Modern Data Architecture
Modern Data Architecture Modern Data Architecture
Modern Data Architecture
Mark Hewitt
 

What's hot (20)

Data mining & data warehousing (ppt)
Data mining & data warehousing (ppt)Data mining & data warehousing (ppt)
Data mining & data warehousing (ppt)
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Big Data Ecosystem
Big Data EcosystemBig Data Ecosystem
Big Data Ecosystem
 
3 pillars of big data : structured data, semi structured data and unstructure...
3 pillars of big data : structured data, semi structured data and unstructure...3 pillars of big data : structured data, semi structured data and unstructure...
3 pillars of big data : structured data, semi structured data and unstructure...
 
Chapter 1 big data
Chapter 1 big dataChapter 1 big data
Chapter 1 big data
 
data warehouse , data mart, etl
data warehouse , data mart, etldata warehouse , data mart, etl
data warehouse , data mart, etl
 
Management Information System & Technology
Management Information System & TechnologyManagement Information System & Technology
Management Information System & Technology
 
Data Warehouse
Data Warehouse Data Warehouse
Data Warehouse
 
NoSQL
NoSQLNoSQL
NoSQL
 
Data Mining Concepts
Data Mining ConceptsData Mining Concepts
Data Mining Concepts
 
Classification of data
Classification of dataClassification of data
Classification of data
 
Introduction to Sharding
Introduction to ShardingIntroduction to Sharding
Introduction to Sharding
 
OLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSEOLAP & DATA WAREHOUSE
OLAP & DATA WAREHOUSE
 
Advanced Dimensional Modelling
Advanced Dimensional ModellingAdvanced Dimensional Modelling
Advanced Dimensional Modelling
 
Modern Metadata Strategies
Modern Metadata StrategiesModern Metadata Strategies
Modern Metadata Strategies
 
Big data by Mithlesh sadh
Big data by Mithlesh sadhBig data by Mithlesh sadh
Big data by Mithlesh sadh
 
Hadoop Architecture
Hadoop ArchitectureHadoop Architecture
Hadoop Architecture
 
Big data ecosystem
Big data ecosystemBig data ecosystem
Big data ecosystem
 
Database security
Database securityDatabase security
Database security
 
Modern Data Architecture
Modern Data Architecture Modern Data Architecture
Modern Data Architecture
 

Viewers also liked

Study of OpenMRS
Study of OpenMRSStudy of OpenMRS
Study of OpenMRS
Shweta Tripathi
 
Visits in OpenMRS 1.9
Visits in OpenMRS 1.9Visits in OpenMRS 1.9
Visits in OpenMRS 1.9
djazayeri
 
Open MRS
Open MRSOpen MRS
Open MRS
Shriman Visahan
 
OpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting StartedOpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting Started
djazayeri
 
Openmrs Use Examples PPT
Openmrs Use Examples PPTOpenmrs Use Examples PPT
Openmrs Use Examples PPT
djazayeri
 
Openmrs Use Examples PDF
Openmrs Use Examples PDFOpenmrs Use Examples PDF
Openmrs Use Examples PDF
djazayeri
 
Health IT and OpenMRS
Health IT and OpenMRSHealth IT and OpenMRS
Health IT and OpenMRS
Saptarshi Purkayastha
 
OpenMRS Transformation
OpenMRS TransformationOpenMRS Transformation
OpenMRS Transformation
Burke Mamlin
 
OpenMRS: htmlforms
OpenMRS: htmlformsOpenMRS: htmlforms
OpenMRS: htmlforms
lnball
 
What Is Open M R S
What Is  Open M R SWhat Is  Open M R S
What Is Open M R S
hamishfraser
 
OpenMRS presentation
OpenMRS presentationOpenMRS presentation
OpenMRS presentation
Sarthak Gulati
 
The open mrs hl7query module
The open mrs hl7query moduleThe open mrs hl7query module
The open mrs hl7query module
Suranga Nath Kasthurirathne
 
OpenMRS Lightning Talk: Pleebo Health Center
OpenMRS Lightning Talk:  Pleebo Health CenterOpenMRS Lightning Talk:  Pleebo Health Center
OpenMRS Lightning Talk: Pleebo Health Center
lnball
 
Bahmni - an open source hospital system
Bahmni - an open source hospital systemBahmni - an open source hospital system
Bahmni - an open source hospital system
Gurpreet Luthra
 
OpenMRS Concept Management Tutorial
OpenMRS Concept Management TutorialOpenMRS Concept Management Tutorial
OpenMRS Concept Management Tutorial
lnball
 
Creative design/marketing: make a presentation slide on OpenMRS
Creative design/marketing: make a presentation slide on OpenMRSCreative design/marketing: make a presentation slide on OpenMRS
Creative design/marketing: make a presentation slide on OpenMRS
uzanysa
 
ITECH Kenya presentation on OpenMRS Developers Forum
ITECH Kenya presentation on OpenMRS Developers ForumITECH Kenya presentation on OpenMRS Developers Forum
ITECH Kenya presentation on OpenMRS Developers Forum
djazayeri
 
What Is OpenMRS (in 3 Min)
What Is OpenMRS (in 3 Min)What Is OpenMRS (in 3 Min)
What Is OpenMRS (in 3 Min)
Burke Mamlin
 
Partners In Health and Medical Informatics overview (brief)
Partners In Health and Medical Informatics overview (brief)Partners In Health and Medical Informatics overview (brief)
Partners In Health and Medical Informatics overview (brief)
lnball
 
Inability to Say NO
Inability to Say NOInability to Say NO
Inability to Say NO
Shweta Tripathi
 

Viewers also liked (20)

Study of OpenMRS
Study of OpenMRSStudy of OpenMRS
Study of OpenMRS
 
Visits in OpenMRS 1.9
Visits in OpenMRS 1.9Visits in OpenMRS 1.9
Visits in OpenMRS 1.9
 
Open MRS
Open MRSOpen MRS
Open MRS
 
OpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting StartedOpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting Started
 
Openmrs Use Examples PPT
Openmrs Use Examples PPTOpenmrs Use Examples PPT
Openmrs Use Examples PPT
 
Openmrs Use Examples PDF
Openmrs Use Examples PDFOpenmrs Use Examples PDF
Openmrs Use Examples PDF
 
Health IT and OpenMRS
Health IT and OpenMRSHealth IT and OpenMRS
Health IT and OpenMRS
 
OpenMRS Transformation
OpenMRS TransformationOpenMRS Transformation
OpenMRS Transformation
 
OpenMRS: htmlforms
OpenMRS: htmlformsOpenMRS: htmlforms
OpenMRS: htmlforms
 
What Is Open M R S
What Is  Open M R SWhat Is  Open M R S
What Is Open M R S
 
OpenMRS presentation
OpenMRS presentationOpenMRS presentation
OpenMRS presentation
 
The open mrs hl7query module
The open mrs hl7query moduleThe open mrs hl7query module
The open mrs hl7query module
 
OpenMRS Lightning Talk: Pleebo Health Center
OpenMRS Lightning Talk:  Pleebo Health CenterOpenMRS Lightning Talk:  Pleebo Health Center
OpenMRS Lightning Talk: Pleebo Health Center
 
Bahmni - an open source hospital system
Bahmni - an open source hospital systemBahmni - an open source hospital system
Bahmni - an open source hospital system
 
OpenMRS Concept Management Tutorial
OpenMRS Concept Management TutorialOpenMRS Concept Management Tutorial
OpenMRS Concept Management Tutorial
 
Creative design/marketing: make a presentation slide on OpenMRS
Creative design/marketing: make a presentation slide on OpenMRSCreative design/marketing: make a presentation slide on OpenMRS
Creative design/marketing: make a presentation slide on OpenMRS
 
ITECH Kenya presentation on OpenMRS Developers Forum
ITECH Kenya presentation on OpenMRS Developers ForumITECH Kenya presentation on OpenMRS Developers Forum
ITECH Kenya presentation on OpenMRS Developers Forum
 
What Is OpenMRS (in 3 Min)
What Is OpenMRS (in 3 Min)What Is OpenMRS (in 3 Min)
What Is OpenMRS (in 3 Min)
 
Partners In Health and Medical Informatics overview (brief)
Partners In Health and Medical Informatics overview (brief)Partners In Health and Medical Informatics overview (brief)
Partners In Health and Medical Informatics overview (brief)
 
Inability to Say NO
Inability to Say NOInability to Say NO
Inability to Say NO
 

Similar to Building an OpenMRS Distribution - Lessons from KenyaEMR

Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
Eduard Tomàs
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
PLovababu
 
Architecting systems for continuous delivery
Architecting systems for continuous deliveryArchitecting systems for continuous delivery
Architecting systems for continuous delivery
Marcel de Vries
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
Code Mastery
 
Serena Release Management approach and solutions
Serena Release Management approach and solutionsSerena Release Management approach and solutions
Serena Release Management approach and solutions
Softmart
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
Sharkrit JOBBO
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
MahmoudZidan41
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
ecubemarketing
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud Road
Gert Drapers
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
Brad Williams
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
Vinod Wilson
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
XPDays
 
TransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSTransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MS
Lana Kalashnyk
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
Eklove Mohan
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating System
AjithaG9
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
Sumit Arora
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
OSSCube
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
Abdul Manaf
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Sergey Platonov
 

Similar to Building an OpenMRS Distribution - Lessons from KenyaEMR (20)

Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.MicroserviceArchitecture in detail over Monolith.
MicroserviceArchitecture in detail over Monolith.
 
Architecting systems for continuous delivery
Architecting systems for continuous deliveryArchitecting systems for continuous delivery
Architecting systems for continuous delivery
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 
Serena Release Management approach and solutions
Serena Release Management approach and solutionsSerena Release Management approach and solutions
Serena Release Management approach and solutions
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server Management
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud Road
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.js
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
TransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSTransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MS
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOps
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating System
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...Dori Exterman, Considerations for choosing the parallel computing strategy th...
Dori Exterman, Considerations for choosing the parallel computing strategy th...
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 

Building an OpenMRS Distribution - Lessons from KenyaEMR

  • 2. Distribution? • Thinking in terms of “distributions” appears a recent development in OpenMRS • Nationwide implementations of OpenMRS are becoming more common (e.g. Rwanda) • Managing 100 sites is a very different challenge to managing 10 sites
  • 3. Challenges of scale • Need for consistency across site installations • Need for simple or automated upgrades and maintenance • Need for scalable user support
  • 4. Site inconsistency • What we want to avoid: Site OpenMRS Concepts Module 1 Module 2 Clinic 1 1.9.3 20140714 2.5.3 0.3 Clinic 2 1.9.3 20131215 2.4.1 1.0-BETA Clinic 3 1.9.7 20131215 2.4 … 0.3.1 … • Endless different environments, most of which won’t have been tested • Becomes impossible to manually track
  • 5. Site inconsistency • More chance of site-specific bugs – Development team might not have tested a site’s particular environment • Complex site-specific upgrade processes – Single components upgraded individually • Confusion for users trained in different environments – National implementations often rely on centralised training events
  • 6. Site consistency • A distribution should define a consistent environment • We can break that down into components: – A version of OpenMRS core – A set of modules with specified versions – A set of metadata objects • Might be versioned SQL dumps or MDS packages • Might include a separately versioned concept dictionary
  • 7. Distribution example • An implementation’s own custom modules will only be a part of the larger distribution: OpenMRS MyModule Reporting MyDistro Idgen HtmlFormEntry CIEL
  • 8. Distribution versioning • Specific versioned releases of all the components make up a single versioned release of the distribution, e.g. OpenMRS 1.9.3 OpenMRS 1.9.7 MyModule 1.0 MyModule 1.1 Reporting 0.8 Reporting 0.8.1 MyDistro 1.0 MyDistro 2.0 Idgen 2.6 Idgen 2.6 HtmlFormEntry 2.5 HtmlFormEntry 2.5.1 CIEL 20120931 CIEL 20140107
  • 9. Distribution versioning • At every stage of the development lifecycle, we should be working with a version of the complete distribution, e.g. Development with an “in-progress” version mydistro-2.0-SNAPSHOT mydistro-2.0-RC1 Testing with release candidate versions mydistro-2.0-RC2 Installations and upgrades with released versions mydistro-2.0
  • 10. Distribution modules • Rather than manage a distribution as a separate project, it can be easier to tie it to a “distribution module” • Its version is the distribution version • Defines the required versions of all other components • Depends on all of the other modules
  • 11. Distribution modules • By requiring all of the other modules the, distribution module ensures that the distribution is always run as a whole <require_modules> <require_module version="0.8.1"> org.openmrs.module.reporting </require_module> <require_module version="2.6"> org.openmrs.module.idgen </require_module> <require_module version="2.5.1"> org.openmrs.module.htmlformentry </require_module> </require_modules>
  • 12. Continuous integration • Don’t want to develop different components in insolation and only realise integration problems during testing • Developers should work with the latest version of the distribution • CI server should be used to keep a testing server up to date with changes to any component
  • 13. Buildable distributions mydistro-2.0-SNAPSHOT mydistro-2.0-distro.zip • Need to make it easy for developers (and CI servers) to deploy a particular version of a distribution • Useful to have a zip archive of the different component modules mymodule-1.1.omod reporting-0.8.1.omod idgen-2.6.omod htmlformentry-2.5.1.omod
  • 14. Buildable distributions • Maven provides a convenient mechanism to produce an archive of a project with its dependencies – called an assembly • Thus our distribution module can have two build outputs: – A regular omod – A distribution zip archive For an example of how to implement this, see: https://github.com/ITECH/openmrs-module-kenyaemr/blob/master/distro
  • 15. Metadata consistency • The idea of site consistency should apply also to metadata • For example: – The distribution does patient registration – This saves encounters of type “Registration” – The distribution can’t function if that encounter type doesn’t exist – Can we guarantee that the encounter type means the same thing in different installations?
  • 16. User managed metadata • Non-distribution modules often expect the user to manage metadata, e.g. – Every time some code tries to access the “Registration” encounter type, check for null – If it doesn’t exist, show the user an error message to tell them to create it – Tell user to set the mydistro.registrationEncounterType global property to reference the new object
  • 17. Distribution managed metadata • If we want to be sure that metadata is the same across all sites, we manage it via code rather than users • Distributions should install required metadata automatically • Distribution code should assume that the metadata exists – If it doesn’t, it is a developer problem rather than a user problem
  • 18. Fail fast assumptions • If we assume that metadata always exists, we should fail-fast if that assumption turns out to be incorrect, e.g. EncounterType ret = Context.getEncounterService().getEncounterTypeByUuid(uuid); if (ret == null) { throw new IllegalArgumentException("No such encounter type with uuid " + uuid); } • Helps developers find problems right away • Easier than tracking down source of a NPE The Metadata Deploy module provides fail-fast fetch methods for most metadata classes: https://github.com/I-TECH/openmrs-module-metadatadeploy
  • 19. Metadata identity • Database ids are not reliable for identifying the same metadata in different installations • Anytime distribution code references metadata it should use one of: – UUID: all OpenMRS classes have these and they can be kept consistent across installations – Reference terms: these are globally consistent and unique identifiers for concepts (and soon also drugs)
  • 20. Metadata installation • One approach is to bundle metadata packages with the distribution and install these on startup • Weaknesses of this approach: – Metadata is not easily readable or editable – Packages typically have to be managed on an external server, exported and embedded into the code – Package installation is slow so usually not appropriate to use the same packages in unit tests
  • 21. Metadata deploy • Module was developed to address these issues – Allows metadata to be defined in code – Metadata is easy to read and edit – Fast installation suitable for unit tests For more information about the Metadata Deploy module go to https://wiki.openmrs.org/display/docs/Metadata+Deploy+Module
  • 22. Metadata deploy • Metadata that’s too lengthy to be described in code can be loaded from CSV files etc – Still more readable than zip archives • Support for synchronization of large sets – Used to synchronize OpenMRS locations with all 9500 facilities in the Kenya Master Facility List: • Clean database synchronization: 1min • Subsequent synchronization: 3-4secs • Previous MDS package load: 20-25mins
  • 23. Concepts? • So far SQL dumps have been best for these: – We don’t manage/edit them directly (we use CIEL) – Database dump is only quick way to install 50,000+ concepts • Groovy script used used to generate XML dataset file of just those concepts used by KenyaEMR – Used for unit tests that need access to same concepts as production environment
  • 24. Example metadata bundle @Component @Requires({ BaseMetadata.class }) public class MyMetadata extends AbstractMetadataBundle { This “bundle” installs an encounter type and two forms public static final class _EncounterType { public static final String ENCOUNTER_TYPE1 = "d3e3d723-7458-4b4e-8998-408e8a551a84"; } public static final class _Form { public static final String FORM1 = "4b296dd0-f6be-4007-9eb8-d0fd4e94fb3a"; public static final String FORM2 = "89994550-9939-40f3-afa6-173bce445c79"; } @Override public void install() { install(encounterType("Encounter Type #1", "Something...", _EncounterType.ENCOUNTER_TYPE1)); install(form("Form #1", null, _EncounterType.ENCOUNTER_TYPE1, "1", _Form.FORM1)); install(form("Form #2", null, _EncounterType.ENCOUNTER_TYPE1, "1", _Form.FORM2)); // A form that should be retired if it exists uninstall(possible(Form.class, "73d34479-2f9e-4de3-a5e6-1f79a17459bb"), "Because..."); } } Also retires a form that’s no longer needed
  • 25. Enforcing consistency • Current OpenMRS UI wasn’t made for this idea of a distribution • Ideally we want to prevent even the super user account from doing things like: – Stopping modules – Deleting or modifying metadata • KenyaEMR overrides the regular UI and provides a custom UI without this functionality
  • 26. Installations and upgrades • OpenMRS itself is usually only one part of a functioning EMR installation • Other parts might be: – The database client and server – The JVM – Tomcat or another Java web app server – Database backup scripts run by cron jobs – Help and training materials
  • 27. Installations and upgrades • For small or single site implementations, developers often do these • Not feasible for large implementations: – Developers can’t physically visit every site – Sites often have connectivity issues – Upgrades need to be performed by less technical users
  • 28. Installation via virtual machine • Working installations require correct configuration of all those parts • Easier to configure once at the office than 100s of times at each site • Can build virtual machine images and clone for all sites
  • 29. Installation via virtual machine • Ongoing experiments with different ways of retaining patient data during upgrade – Moving data from old to new VM via SQL dump – Separate VMs for database (not replaced) and web app (replaced) • Other experiments using bittorrent to download VM images to sites – Works even when connectivity is very poor
  • 30. Maintenance • Things inevitably go wrong, e.g. – Sites could end up with invalid data due to a software bug – Might need to convert data as software changes • Modules can provide liquibase files to make one time changes – Not always easy or possible to do something with just SQL
  • 31. Automated fixes • Requiring user intervention should be a last resort • KenyaEMR provides its own automated way of making fixes called chores: – Java classes which perform a one-time job – Run at the end of KenyaEMR startup so have access to all metadata and services See KenyaEMR source for examples of chore classes: https://github.com/ITECH/openmrs-modulekenyaemr/tree/master/api/src/main/java/org/openmrs/module/kenyaemr/chor e
  • 32. User support • Need clear processes for issue tracking: – More technical site staff can create support tickets directly in ticketing system – Less technical site staff can use email or phone and then support staff will create ticket • Help materials need to be easily accessible to site users
  • 33. User support • KenyaEMR integrates with external help site • Users can lookup help documents and videos • Can provide context sensitive help within different apps Help site code available at https://github.com/I-TECH/helpsite