From d0f6d1fcad80d6e3237afc0274cb5e6d19704e49 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Wed, 14 Dec 2022 16:51:00 +0000 Subject: [PATCH] custom modules --- Runbooks/openemr-dev-custom-modules | 41 +++++++++++++++++++++++++++ Runbooks/openemr-dev-env-docker.md | 43 ++++++++++++++++++++++------- 2 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 Runbooks/openemr-dev-custom-modules diff --git a/Runbooks/openemr-dev-custom-modules b/Runbooks/openemr-dev-custom-modules new file mode 100644 index 0000000..01a2206 --- /dev/null +++ b/Runbooks/openemr-dev-custom-modules @@ -0,0 +1,41 @@ +# OpenEMR Custom Modules + +## INTRODUCTION +Why use a module +- Package of functionality independent of the core app +- Administrators can manage functionality +- SOLID +Geared toward small scale projects. For larger, more complex modules you may want to use the Laminas framework. + +## CUSTOM SQL +During installation of the module, OpenEMR will run +table.sql + +## FORK THE SKELETON FRAMEWORK +1. Go to adunsulag/oe-module-custom-skeleton in GitHub +2. Click the Fork button to make a fork in your GitHub + +## INSTALL SKELETON FRAMEWORK +Take the time to read the instructions provided in the GitHub repo +1. Launch your development IDE and open OpenEMR +2. Change to the /interface/modules/custom_modules directory +3. Clone your fork + +```git +git clone git@github.com:KenSchae/oe-module-cutom-skeleton.git +``` + +## UPDATE composer.json +``` +"psr-4": { + "OpenEMR\\": "src", + "OpenEMR\\Modules\\CustomModuleSkeleton\\": "interface/modules/custom_modules/oe-module-custom-skeleton/src/" +} +``` + +Run from the docker folder /docker/development-easy +`composer dump-autoload` + + +## REFERENCES +- [OpenEMR Modules YouTube](https://youtu.be/LYA8MosIWF0) \ No newline at end of file diff --git a/Runbooks/openemr-dev-env-docker.md b/Runbooks/openemr-dev-env-docker.md index c0ec444..8141265 100644 --- a/Runbooks/openemr-dev-env-docker.md +++ b/Runbooks/openemr-dev-env-docker.md @@ -1,16 +1,21 @@ # OpenEMR Development Environment (Docker) ## TABLE OF CONTENTS -- [Build Development Server](#build-development-server) -- [Connect Workstation to Server](#connect-workstation-to-server) -- [Config Server](#config-server) -- [Install OpenEMR-cmd](#install-openemr-cmd) -- [Fork the GitHub Repo](#fork-the-github-repo) -- [Start the Dockers](#start-the-dockers) -- [Test OpenEMR](#test-openemr) -- [Sling Some Code](#sling-some-code) -- [Sample Patient Data](#sample-patient-data-with-synthea) -- [References](#references) +- [OpenEMR Development Environment (Docker)](#openemr-development-environment-docker) + - [TABLE OF CONTENTS](#table-of-contents) + - [BUILD DEVELOPMENT SERVER](#build-development-server) + - [CONNECT WORKSTATION TO SERVER](#connect-workstation-to-server) + - [CONFIG SERVER](#config-server) + - [INSTALL OPENEMR-CMD](#install-openemr-cmd) + - [FORK THE GITHUB REPO](#fork-the-github-repo) + - [START THE DOCKERS](#start-the-dockers) + - [BUILD](#build) + - [TEST OPENEMR](#test-openemr) + - [SLING SOME CODE](#sling-some-code) + - [SAMPLE PATIENT DATA WITH SYNTHEA](#sample-patient-data-with-synthea) + - [MANAGE DOCKERS](#manage-dockers) + - [Resetting the environment](#resetting-the-environment) + - [REFERENCES](#references) ## BUILD DEVELOPMENT SERVER The OpenEMR video series (and many home lab tutorials) walk you through creating a Linux VM to develop with. The assumption in these videos is that you will use the VM as a workstation AND as a server: everything in one box. I don't like that approach. My preference is to create the VM as a server and then connect to the server from a workstation. @@ -55,6 +60,19 @@ Host arbitrary-name-that-displays-in-vscode 5. `docker ps` there are 5 dockers for the OpenEMR environment 6. `openemr-cmd dl` keep running this until the docker is done building (e.g.Apache is running) +### BUILD + +If using OpenEMR directly from the code repository, then the following commands will build OpenEMR (Node.js version 16.* is required). This should be done from inside of the docker container + +`openemr-cmd s` + +```shell +composer install --no-dev +npm install +npm run build +composer dump-autoload -o +``` + ## TEST OPENEMR 1. Open a browser 2. http://hostname-or-ip-of-server:8300 @@ -78,6 +96,11 @@ Host arbitrary-name-that-displays-in-vscode 4. Let's be real, I like all donuts 5. I am the Homer Simpson of full stack developers +## MANAGE DOCKERS + +### Resetting the environment + + ## REFERENCES - [OpenEMR Development Docker Environment](https://github.com/openemr/openemr/blob/master/CONTRIBUTING.md#starting-with-openemr-development-docker-environment) - [Presentation Slides](https://docs.google.com/presentation/d/13VhN_uL-YptFtM1qv3pJ6DwhMnz9tNrAtUSbMEpHMLU/edit#slide=id.p)