SlideShare ist ein Scribd-Unternehmen logo
1 von 34
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!

Weitere ähnliche Inhalte

Was ist angesagt?

Three Approaches to Predictive Analytics in Healthcare
Three Approaches to Predictive Analytics in HealthcareThree Approaches to Predictive Analytics in Healthcare
Three Approaches to Predictive Analytics in HealthcareHealth Catalyst
 
Ways to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performanceWays to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performanceMala Deep Upadhaya
 
ACCENT Hospital Management System
ACCENT  Hospital  Management  SystemACCENT  Hospital  Management  System
ACCENT Hospital Management SystemACCENT Trading
 
Faster and Cheaper Clinical Trials: The Benefit of Synthetic Data
Faster and Cheaper Clinical Trials: The Benefit of Synthetic DataFaster and Cheaper Clinical Trials: The Benefit of Synthetic Data
Faster and Cheaper Clinical Trials: The Benefit of Synthetic Dataaccenture
 
Dynamic Information Retrieval Tutorial - SIGIR 2015
Dynamic Information Retrieval Tutorial - SIGIR 2015Dynamic Information Retrieval Tutorial - SIGIR 2015
Dynamic Information Retrieval Tutorial - SIGIR 2015Marc Sloan
 
Data Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model SelectionData Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model SelectionDerek Kane
 
Open Cloud Consortium Overview (01-10-10 V6)
Open Cloud Consortium Overview (01-10-10 V6)Open Cloud Consortium Overview (01-10-10 V6)
Open Cloud Consortium Overview (01-10-10 V6)Robert Grossman
 
Telecom Churn Prediction Presentation
Telecom Churn Prediction PresentationTelecom Churn Prediction Presentation
Telecom Churn Prediction PresentationPinintiHarishReddy
 
Streaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesStreaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesNatalino Busa
 
Customer Churn Analysis and Prediction
Customer Churn Analysis and PredictionCustomer Churn Analysis and Prediction
Customer Churn Analysis and PredictionSOUMIT KAR
 
Association rule mining.pptx
Association rule mining.pptxAssociation rule mining.pptx
Association rule mining.pptxmaha797959
 
Machine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityMachine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityPier Luca Lanzi
 
Classification and regression trees (cart)
Classification and regression trees (cart)Classification and regression trees (cart)
Classification and regression trees (cart)Learnbay Datascience
 
Introduction to ETL process
Introduction to ETL process Introduction to ETL process
Introduction to ETL process Omid Vahdaty
 
Classification
ClassificationClassification
ClassificationCloudxLab
 

Was ist angesagt? (20)

Three Approaches to Predictive Analytics in Healthcare
Three Approaches to Predictive Analytics in HealthcareThree Approaches to Predictive Analytics in Healthcare
Three Approaches to Predictive Analytics in Healthcare
 
Ensemble methods
Ensemble methodsEnsemble methods
Ensemble methods
 
Ways to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performanceWays to evaluate a machine learning model’s performance
Ways to evaluate a machine learning model’s performance
 
ACCENT Hospital Management System
ACCENT  Hospital  Management  SystemACCENT  Hospital  Management  System
ACCENT Hospital Management System
 
Faster and Cheaper Clinical Trials: The Benefit of Synthetic Data
Faster and Cheaper Clinical Trials: The Benefit of Synthetic DataFaster and Cheaper Clinical Trials: The Benefit of Synthetic Data
Faster and Cheaper Clinical Trials: The Benefit of Synthetic Data
 
Data warehousing
Data warehousingData warehousing
Data warehousing
 
Apriori algorithm
Apriori algorithmApriori algorithm
Apriori algorithm
 
Dynamic Information Retrieval Tutorial - SIGIR 2015
Dynamic Information Retrieval Tutorial - SIGIR 2015Dynamic Information Retrieval Tutorial - SIGIR 2015
Dynamic Information Retrieval Tutorial - SIGIR 2015
 
Data Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model SelectionData Science - Part III - EDA & Model Selection
Data Science - Part III - EDA & Model Selection
 
Open Cloud Consortium Overview (01-10-10 V6)
Open Cloud Consortium Overview (01-10-10 V6)Open Cloud Consortium Overview (01-10-10 V6)
Open Cloud Consortium Overview (01-10-10 V6)
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
 
Telecom Churn Prediction Presentation
Telecom Churn Prediction PresentationTelecom Churn Prediction Presentation
Telecom Churn Prediction Presentation
 
Streaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologiesStreaming computing: architectures, and tchnologies
Streaming computing: architectures, and tchnologies
 
Customer Churn Analysis and Prediction
Customer Churn Analysis and PredictionCustomer Churn Analysis and Prediction
Customer Churn Analysis and Prediction
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
 
Association rule mining.pptx
Association rule mining.pptxAssociation rule mining.pptx
Association rule mining.pptx
 
Machine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityMachine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and Credibility
 
Classification and regression trees (cart)
Classification and regression trees (cart)Classification and regression trees (cart)
Classification and regression trees (cart)
 
Introduction to ETL process
Introduction to ETL process Introduction to ETL process
Introduction to ETL process
 
Classification
ClassificationClassification
Classification
 

Andere mochten auch

Visits in OpenMRS 1.9
Visits in OpenMRS 1.9Visits in OpenMRS 1.9
Visits in OpenMRS 1.9djazayeri
 
OpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting StartedOpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting Starteddjazayeri
 
Openmrs Use Examples PPT
Openmrs Use Examples PPTOpenmrs Use Examples PPT
Openmrs Use Examples PPTdjazayeri
 
Openmrs Use Examples PDF
Openmrs Use Examples PDFOpenmrs Use Examples PDF
Openmrs Use Examples PDFdjazayeri
 
OpenMRS Transformation
OpenMRS TransformationOpenMRS Transformation
OpenMRS TransformationBurke Mamlin
 
OpenMRS: htmlforms
OpenMRS: htmlformsOpenMRS: htmlforms
OpenMRS: htmlformslnball
 
What Is Open M R S
What Is  Open M R SWhat Is  Open M R S
What Is Open M R Shamishfraser
 
OpenMRS Lightning Talk: Pleebo Health Center
OpenMRS Lightning Talk:  Pleebo Health CenterOpenMRS Lightning Talk:  Pleebo Health Center
OpenMRS Lightning Talk: Pleebo Health Centerlnball
 
Bahmni - an open source hospital system
Bahmni - an open source hospital systemBahmni - an open source hospital system
Bahmni - an open source hospital systemGurpreet Luthra
 
OpenMRS Concept Management Tutorial
OpenMRS Concept Management TutorialOpenMRS Concept Management Tutorial
OpenMRS Concept Management Tutoriallnball
 
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 OpenMRSuzanysa
 
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 Forumdjazayeri
 
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
 

Andere mochten auch (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
 

Ähnlich wie 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 deliveryMarcel de Vries
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practicesCode Mastery
 
Serena Release Management approach and solutions
Serena Release Management approach and solutionsSerena Release Management approach and solutions
Serena Release Management approach and solutionsSoftmart
 
Windows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementWindows 2012 R2 Multi Server Management
Windows 2012 R2 Multi Server ManagementSharkrit JOBBO
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkinsecubemarketing
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud RoadGert Drapers
 
ThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsThatConference 2016 - Highly Available Node.js
ThatConference 2016 - Highly Available Node.jsBrad Williams
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0Vinod 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_monolithMarkus Eisele
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous IntegrationXPDays
 
TransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSTransitioningToMicroServonDocker_MS
TransitioningToMicroServonDocker_MSLana Kalashnyk
 
Preparing for DevOps
Preparing for DevOpsPreparing for DevOps
Preparing for DevOpsEklove Mohan
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating SystemAjithaG9
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN ControllerSumit 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 AvailabilityOSSCube
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera ClusterAbdul 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
 

Ähnlich wie 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...
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

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