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?

Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itBenjamin Delpy
 
Final year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing serverFinal year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing serversachin993
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseTakahiro Haruyama
 
Report on Dental treatment & management system
Report on Dental treatment &  management system Report on Dental treatment &  management system
Report on Dental treatment & management system Zakirul Islam
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
Ngo management system.
Ngo management system.Ngo management system.
Ngo management system.PallaviKadam
 
Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Achal (अचल) Porwal
 
Steps of-creating-a-database
Steps of-creating-a-databaseSteps of-creating-a-database
Steps of-creating-a-databaseAIMS Education
 
Cyber forensics lab 4
Cyber forensics lab 4Cyber forensics lab 4
Cyber forensics lab 4MUSAAB HASAN
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020Vikram Singh
 
Data leakage detection
Data leakage detectionData leakage detection
Data leakage detectionVikrant Arya
 
Hospital Management System
Hospital Management SystemHospital Management System
Hospital Management SystemRup Chowdhury
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTIONAnoop T
 
Srs hospital management
Srs hospital managementSrs hospital management
Srs hospital managementmaamir farooq
 

Was ist angesagt? (20)

Abusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get itAbusing Microsoft Kerberos - Sorry you guys don't get it
Abusing Microsoft Kerberos - Sorry you guys don't get it
 
Final year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing serverFinal year project report on Internet And Interanet Emailing server
Final year project report on Internet And Interanet Emailing server
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCase
 
Report on Dental treatment & management system
Report on Dental treatment &  management system Report on Dental treatment &  management system
Report on Dental treatment & management system
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
Data Dissemination and Synchronization
Data Dissemination and SynchronizationData Dissemination and Synchronization
Data Dissemination and Synchronization
 
Ngo management system.
Ngo management system.Ngo management system.
Ngo management system.
 
Linux security
Linux securityLinux security
Linux security
 
Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)Sequence diagram for employee management system(EMS)
Sequence diagram for employee management system(EMS)
 
Steps of-creating-a-database
Steps of-creating-a-databaseSteps of-creating-a-database
Steps of-creating-a-database
 
Cyber forensics lab 4
Cyber forensics lab 4Cyber forensics lab 4
Cyber forensics lab 4
 
Final year project working documentation 2020
Final year project working documentation 2020Final year project working documentation 2020
Final year project working documentation 2020
 
Data leakage detection
Data leakage detectionData leakage detection
Data leakage detection
 
Hospital Management System
Hospital Management SystemHospital Management System
Hospital Management System
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Nfs
NfsNfs
Nfs
 
Srs hospital management
Srs hospital managementSrs hospital management
Srs hospital management
 
Srs for banking system
Srs for banking systemSrs for banking system
Srs for banking system
 
Nikto
NiktoNikto
Nikto
 
Hospital management system
Hospital management systemHospital management system
Hospital management system
 

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

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Kürzlich hochgeladen (20)

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

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