Developing the "OCL for OpenMRS" Application

I would be cautious of connecting up a development or QA site to the production OCL site. That would seem to be a bad architectural decision given the data is being written to the OCL site. I think we need to have a copy of the CIEL source on DEV/QA long before we point a production version of the OpenMRS-OCL module to production OCL… my two cents :slight_smile:

Thanks for pointing that out. About that, on the demo call, @darius had requested @paynejd to load the CIEL data to the QA environment. So we hope to use actual CIEL data in this sprint.

1 Like

Hi @cintiadr, is it possible to add some environment variables to the QA environment? I’m asking because we created some environment variables locally, and we would like to have them online too.

1 Like

Well, it’s hard to guess what you mean by that, but I’m going to explain how the environment work, and you should be able to infer what you need.

OCL for OpenMRS is deployed as docker image, inside your repository. It’s built as

docker build --force-rm=true --tag=<tag> .

You are free to change this docker image any way you want. But the docker image is shared across all environments (e.g., the same docker image deployed to QA will eventually be deployed to prod).

When the docker container is started, you configured it to start nginx command. You could make it call a bash script and do any preprocessing you wanted.

Check your readme, it explains exactly how to run docker locally.


If you want to give your docker container environment variables that it will manipulate during build time, please create a pull request to your docker-compose file. You should be able to run it locally too.


To sum up, you have full control of your docker image. If you want to pass runtime environment variables, create a pull request and I will deploy.

Here an example of a docker-compose that receives environment variables, and parse them during start up:

Your docker entrypoint is responsible for retrieving the environment variables and do whatever they want.

You can test this all locally.

I suppose you managed to get it working?

I’m legitimately curious about what you mean by ‘add some environment variables’ for a client-side only app, served as static files via nginx.

Hello @darius and @paynejd, Hope you are okay. I am following up on the discussion we had on the demo call to help populate the QA environment with the actual CIEL data. This will help us to actually test with the real data and avoid any future errors caused by the tests carried out on dummy data that we are using.

@paynejd do you have a way to load some CIEL concepts into the QA server?

1 Like

Hi all, unlike staging and production, content on the QA server is automatically wiped with each code deployment. We could include a test set of CIEL concepts and mappings in the content deployed on QA. I can provide the starter set of content, but would need some help figuring out how to have that automatically imported into QA.

1 Like

Thanks for the feedback @darius and @paynejd. We shall be waiting when it is resolved.

I don’t really know if that’s only needed in your mongodb, I look on its documentation:

Initializing a fresh instance

When a container is started for the first time it will execute files with extensions .sh and .js that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. .js files will be executed by mongo using the database specified by the MONGO_INITDB_DATABASE variable, if it is present, or test otherwise. You may also switch databases within the .js script.

That can be done inside the docker-compose repo. I don’t have a mongodb example, but I have plenty of postgres ones initialising data.

If you need it in flower or redis, then we’d need to look for each individual doc.


Other option would be the OCL QA client to connect to OCL api STG, or create a new OCL client in STG. It’s not hard.

1 Like

Hi all, thanks for.your focus on this. I am in transit and unfortunately will be offline for most of the next 3 weeks due to work travel and vacation. I can prepare the import files while offline but unfortunately it’s going to take quite awhile if you rely on me for the code change (if I can do it at all!). If you are not able to resolve you can reach out to Rafal for assistance as well. I’ll provide the import files as soon as I can.

1 Like

@paynejd Enjoy your vacation. Will be looking forward to any updates on the files

Hello community, Hope you are doing okay. As we come to the end of sprint six, could you please vote for the best date and time for our Demo. Thank you.

Is it possible to add another time slot for latter time?

1 Like

@dkayiwa It is possible. But by latter time do you mean the date or time

I mean time. But if you can also add an extra day, that would be awesome!

Alright let me adjust the time 5-6pm for the 2 days. Is that okay.

Is it possible to also add a day?

It is possible. Let me add Thursday. Same time