A variety of handy bash, SQL, and Python scripts. See below for a quick description of each file.
Installs and launches a Buendia OpenMRS server on an Amazon EC2 instance.
(This script first installs all the necessary dependencies and yum
packages,
then runs openmrs_setup
, openmrs_build
, and openmrs_run
.)
A SQL file containing the concepts that were added and edited for Buendia.
Generated by dump_new_concepts_sql.py
.
A SQL script that resets an OpenMRS database to an empty state (no patients, observations, encounters, orders, or visits).
Wraps an XML XForm instance in a JSON object for posting via REST.
Inverse of convert_to_xml.py
.
Extracts the XML XForm instance from a JSON object wrapper.
Inverse of convert_to_json.py
.
Removes packages whose current version is unchanged from the previous version. (Typically run after building all the packages.)
Demo data with a few patients. Input for generate_site_sql.py
.
Minimal demo data. Input for generate_site_sql.py
.
Compares two .deb files to see if they are the same in all their contents
except for the version number declared in the control file. Used by dedupdeb
.
Download the various OpenJDK package dependencies to a given directory. Currently, this gets openjdk-7 from experimental, tomcat7 from jessie, and some of their dependencies from sid. Downloads files for both amd64 and i386.
See the openjdk-7.md documentation file for more details.
Examines an OpenMRS database, using some heuristics to find all the concepts
we have added or edited beyond the standard CIEL concepts, and dumps that
data to a SQL file (see buendia_concept_dictionary.sql
).
Fetches a file from a URL to a local path. Files are cached in /tmp and the network download is skipped if the requested file is already in the cache.
Downloads the artifacts from the latest successful build of a given project and branch on CircleCI.
Given a directory full of *.sql
table schemas, produces the SQL commands to
renumber concept_id
s according to a concept_renumbering
table.
Takes a JSON description of some data (such as demo.json
) and generates
a SQL script that will construct the entities (users, patients, observations,
locations, and concepts) in the JSON file in the various OpenMRS tables.
A script that was never written.
Given a directory full of *.sql
table schemas, produces the SQL commands to
replace all the foreign key references to users.user_id
with @buendia_admin
.
Print a suitable Debian package version number based on the current build situation.
Uses HTTP to fetch all the patients from an OpenMRS server using the Buendia API, and prints out each patient record as a JSON object.
Installs a Buendia OMOD on an OpenMRS server, replacing any existing Buendia module, and restarts the server to apply the change.
Indexes a particular suite of Debian packages within a given apt repository directory.
Produces a cleaned snapshot of an entire OpenMRS database as a zip file of
SQL dumps. "Cleaned" means the snapshot has been cleaned by clear_server.sql
and contains no patients or observations.
Constructs a zip package containing the specified RC (release candidate) builds of the client APK and the server module, together with scripts to provision them onto an Edison. Takes as input a cleaned database dump and the site-specific initialization SQL.
Builds a Debian .deb
package from a control file and data files.
Sets up an OpenMRS user with a given username and password.
Builds the Buendia module and installs it in an OpenMRS development server.
Dumps an entire MySQL database as a zip file containing a SQL dump of each table and a SQL script to load all the tables into a database.
Ensures that the OpenMRS SDK has been installed and configured.
Loads a dump file (produced by openmrs_dump
) into a MySQL database.
Starts a local OpenMRS server for development. Typically used after
openmrs_build
.
Sets up a local OpenMRS server with a MySQL database, for development.
A typical sequence of commands is openmrs_setup
, then openmrs_build
,
then openmrs_run
.
Generates some fake patient records and posts them to the Buendia API. Typically used to fill up a database with some dummy data for load testing purposes.
Sets up a GCE instance with demo data (such as demo.json
).
Given a Buendia profile (a CSV file), constructs the charts, forms, and concepts described by the profile in the MySQL database. This script is invoked when you click the "Apply" button on the "Manage Buendia Profiles" page.
Performs a cursory check that a given CSV file has the general form of a Buendia profile.
Scans a Debian apt pool stored in Git and destructively removes all but the n newest versions of each package. Intended primarily to be run from CI. Use with extreme caution.
A collection of useful Bash functions for running shell commands on a remote host.
This directory contains scripts for stress-testing a Buendia server.
A Buendia profile containing a form with some basic fields for testing.
A stress-testing script that attempts to rapidly and concurrently post patients with duplicate IDs to a Buendia API, to verify that the Buendia server correctly enforces uniqueness of patient IDs in its database.
Manually triggers a rebuild for the projectbuendia.github.io apt repo in CircleCI. Intended as an aid to CI development.
Copies Debian packages into an apt repository which is also a Github repository
from a given source path, deduplicates the packages, re-indexes the apt
repository, then commits the changes to git and pushes the whole mess up to
Github. Currently, we are using the gh-pages
branch of the
projectbuendia/builds project,
which points to https://projectbuendia.github.io/builds/.
Makes some requests to a Buendia API to confirm that it's running and available. When a server has been idle for a while, or has just booted, issuing these requests has the side effect of warming up the server so it is ready to respond more quickly to the next request.