# How to run OpenElis from source code?

**URL:** <https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17>\
**Category:** Ask OpenELIS\
**Tags:** dev\
**Created:** [December 10, 2019, 2:05pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17 "2019-12-10T14:05:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sohel](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sohel](https://talk.openelis-global.org/u/sohel)\
**Post date:** [December 10, 2019, 2:05pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/1 "2019-12-10T14:05:50Z")

</div>

Dear Team,

I want to run openelis from source and want to give a try of my own. I have couple of questions  
First of all which branch should I run ? ( that includes latest stable sources). I have found source from here

> **[GitHub - I-TECH-UW/OpenELIS-Global-2: OpenELIS 2.X is a rewrite of the...](https://github.com/I-TECH-UW/OpenELIS-Global-2/)**
>
> OpenELIS 2.X is a rewrite of the original OpenELIS global with updated components and technology - GitHub - I-TECH-UW/OpenELIS-Global-2: OpenELIS 2.X is a rewrite of the original OpenELIS global wi...

and here

> **[GitHub - openelisglobal/openelisglobal-core: Global OpenELIS (Enterprise...](https://github.com/openelisglobal/openelisglobal-core)**
>
> Global OpenELIS (Enterprise Laboratory Information System) is an initiative to provide laboratory information systems for resource-constrained international clinical and reference laboratories. - G...

Second looking for basic guideline for developer on how to start?

like which IDE/tools to use?  
What are the steps need to follow to run the code?  
Any technical documentation on source like technology involved what goes where?  
Source files to feature mapping?  
Description of configuration involved (if any)?  
Any prerequisite or important steps required which might have dependency?  
Description of database?  
and so on.

I am not sure this is right place for this discussion and if this is not please ignore my messages.

---

<div class="post-metadata">

**Author:** ![caseyi](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/caseyi/32/65_2.png) [@caseyi](https://talk.openelis-global.org/u/caseyi)\
**Post date:** [December 12, 2019, 9:15pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/2 "2019-12-12T21:15:37Z")

</div>

Thank you for posting.

The OE Global 2 is the correct repo:

I’m working on updating the read the docs, but here are guides on how to set up your dev env.

> **[Copy of DeveloperSetup](https://docs.google.com/document/d/1lcsALQ7H4_5zgsilYiFtAF_GXELhOkflW9-ZOAn9_Ik/edit?usp=sharing)**
>
> OEGlobal PGAdmin Database Setup Unchanged from before. Follow instructions on wiki. OEGlobal Eclipse Setup \* If you are going to run your development environment in Docker (recommended) then you do not need to do the steps to setup Tomcat in Eclipse...

They also refer back to the Wiki: [https://github.com/openelisglobal/openelisglobal-core/wiki](https://github.com/openelisglobal/openelisglobal-core/wiki) for some of the basics.

I hope these help!

Best,  
Casey

---

<div class="post-metadata">

**Author:** ![sohel](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sohel](https://talk.openelis-global.org/u/sohel)\
**Post date:** [December 14, 2019, 4:40am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/3 "2019-12-14T04:40:30Z")

</div>

@caseyi thanks you very much. These are really helpful and life saver 🙂

Thanks,  
Sohel

---

<div class="post-metadata">

**Author:** ![sohel](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sohel](https://talk.openelis-global.org/u/sohel)\
**Post date:** [December 15, 2019, 1:33pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/4 "2019-12-15T13:33:27Z")

</div>

@caseyi,

I can run maven clean and maven install with success, which also creates OpenELIS.war in target but could not run it in tomcat. I am trying tomcat in eclipse. My tomcat version is 9 and eclipse version is 2019-09. I am not getting an option of select OpenELIS-Global-2 and add into server. Can you please help me with suggestion which steps I may missed?

---

<div class="post-metadata">

**Author:** ![calebslane](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/calebslane/32/330_2.png) [@calebslane](https://talk.openelis-global.org/u/calebslane)\
**Post date:** [December 18, 2019, 9:33pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/5 "2019-12-18T21:33:12Z")

</div>

@sohel If you right click on the tomcat server in the “server” tab is there an option for “add and remove”? If that button exists and OpenELIS doesn’t exist as an “add” option then in it, then that makes me think that the project somehow got misconfigured on eclipse’s auto-import. It may be fixed by trying to recreate the project.

Did you run the maven clean install through eclipse or using maven command line utility?  
Are there any errors detected in the project?

---

<div class="post-metadata">

**Author:** ![sohel](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sohel](https://talk.openelis-global.org/u/sohel)\
**Post date:** [December 22, 2019, 1:34pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/6 "2019-12-22T13:34:48Z")

</div>

@calebslane,

Thanks for your quick and details reply. You were correct I mis-configured on eclipse auto-import . That I have fixed by recreation of the project. Now tomcat is running from eclipse and trying to deploy OpenELIS.war that I have created through running “mvn clean” and “mvn clean install” from eclipse. But still I am getting the following error,

19:05:24.905 [localhost-startStop-1] ERROR org.hibernate.tuple.entity.PojoEntityTuplizer - HHH000243: Setters of lazy classes cannot be final: org.openelisglobal.observationhistory.valueholder.ObservationHistory.value  
19:05:24.957 [localhost-startStop-1] ERROR org.hibernate.tuple.entity.PojoEntityTuplizer - HHH000243: Setters of lazy classes cannot be final: org.openelisglobal.observationhistory.valueholder.ObservationHistory.valueType  
**19:05:32.639 [localhost-startStop-1] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ERROR: column siteinform0\_.description\_key does not exist**  
Position: 536  
19:05:32.997 [localhost-startStop-1] ERROR org.openelisglobal.common.log.LogEvent - Class: org.hibernate.internal.ExceptionConverterImpl, Method: convert, Error: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet  
Dec 22, 2019 7:05:33 PM org.apache.catalina.core.StandardContext listenerStart

I have created clinlims database, given all priviliges to clinlims user and created password for clinlims user that used in VM arguments.

Once I tried with importing backup file in newly crated database and once I have not import any db backup file in my newly created database both cases found the same error. Can you please guide me what I am missing?

Thanks in advance for your help.

–Sohel

---

<div class="post-metadata">

**Author:** ![sohel](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sohel](https://talk.openelis-global.org/u/sohel)\
**Post date:** [December 22, 2019, 2:09pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/7 "2019-12-22T14:09:29Z")

</div>

> [@calebslane](#):
>
> Are there any errors detected in the project?

For your trace I have only error in my project is,

/OpenELIS-Global-2-develop/src/main/webapp/pages/resultLimits/resultLimitsMenu.jsp file where it is complaining about “org.openelisglobal.resultlimits.form” import can not be resolved. But this did not stop me build and install of the project.

Thanks,  
Sohel

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 13, 2020, 8:39am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/8 "2020-08-13T08:39:27Z")

</div>

Hi team!

While following the guide shared above, I run into the following error for which I created an [issue on github](https://github.com/I-TECH-UW/OpenELIS-Global-2/issues/158#issue-678256519).

`[ERROR] Failed to execute goal on project openelisglobal: Could not resolve dependencies for project org.openelisglobal:openelisglobal:war:1.0.0.0: Could not find artifact org.itech:dataexport-api:jar:0.0.0.1`.

Has anyone faced this and how can I resolve it? Thanks all.

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 14, 2020, 9:19am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/9 "2020-08-14T09:19:56Z")

</div>

Hi team, I finally managed to build the OpenELIS Global project after installing the `dataexport` artifact locally. I’m however experiencing issues when firing up the docker containers with below error:

```auto
Pulling fhir.openelis.org (hapi-fhir-jpaserver-starter:)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]n
ERROR: pull access denied for hapi-fhir-jpaserver-starter, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

```

I couldn’t substitute `hapi-fhir-jpaserver-starter` with images from other repositories and would therefore assume there is a specific version that closely couples with the OpenELIS Global. Could I be missing something before doing a `docker-compose up`?

---

<div class="post-metadata">

**Author:** ![calebslane](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/calebslane/32/330_2.png) [@calebslane](https://talk.openelis-global.org/u/calebslane)\
**Post date:** [August 19, 2020, 12:36am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/10 "2020-08-19T00:36:40Z")

</div>

Hi @ruhanga,

The `hapi-fhir-jpaserver-starter` image is unfortunately not listed on any docker repos, but it is included as a submodule inside the OpenELIS-Global project. If you are able to pull the submodules, you should be able to build the `hapi-fhir-jpaserver-starter` image by running `mvn clean install dockerfile:build` while you are located in the hapi-fhir-jpaserver-starter directory.

Hopefully this fixes your issue!

Caleb

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 19, 2020, 12:51pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/11 "2020-08-19T12:51:29Z")

</div>

Thanks @calebslane. The above suggestion doesn’t work either. I was trying to find out how the `hapi-fhir-jpaserver-starter` image is constructed and configured, but failed to figure out the connecting dot (involved artifacts) for `hapi-fhir-jpaserver-starter` docker image. I’m resorting to the [standard approach](http://docs.openelisci.org/en/latest/install/) for now since I’d like to have a running instance for a couple of test runs.

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 21, 2020, 3:39am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/12 "2020-08-21T03:39:13Z")

</div>

@calebslane, could you share any documentation for the OpenELIS Global 2 api documentation? I’m most interested in the fhir component of the api so I can make reference to it. Thank you.

---

<div class="post-metadata">

**Author:** ![calebslane](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/calebslane/32/330_2.png) [@calebslane](https://talk.openelis-global.org/u/calebslane)\
**Post date:** [August 27, 2020, 11:13pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/13 "2020-08-27T23:13:43Z")

</div>

@ruhanga the fhir api server we used has some of their documentation located at [https://hapifhir.io/hapi-fhir/docs/server\_jpa/configuration.html](https://hapifhir.io/hapi-fhir/docs/server_jpa/configuration.html). Is there any other components you require documentation for?

---

<div class="post-metadata">

**Author:** ![mksrom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mksrom/32/21_2.png) [@mksrom](https://talk.openelis-global.org/u/mksrom)\
**Post date:** [August 31, 2020, 2:06pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/14 "2020-08-31T14:06:30Z")

</div>

> [@ruhanga](#):
>
> I finally managed to build the OpenELIS Global project after installing the `dataexport` artifact locally

Hi @ruhanga, how did you achieve that?

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 31, 2020, 2:13pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/15 "2020-08-31T14:13:24Z")

</div>

Hi @mksrom, I simply ran `mvn clean install` on a cloned [`dataexport` project](https://github.com/I-TECH-UW/dataexport) with a minimum of java 11.

---

<div class="post-metadata">

**Author:** ![ruhanga](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@ruhanga](https://talk.openelis-global.org/u/ruhanga)\
**Post date:** [August 31, 2020, 2:36pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/16 "2020-08-31T14:36:29Z")

</div>

Thanks @calebslane, I had wanted and would still like to know the possible api calls I could make when requesting resources/querying OpenELIS Global 2 with FHIR. My understanding is there are a few operations between FHIR and OpenELIS Global 2 that are supported and relevant to the later. Is there any documentation on these for further developments upon? I’m specifically interested in the handling of bundled FHIR resources, say for instance creation of a `Patient` and `ServiceRequest` in one bundled request.

---

<div class="post-metadata">

**Author:** ![calebslane](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/calebslane/32/330_2.png) [@calebslane](https://talk.openelis-global.org/u/calebslane)\
**Post date:** [September 1, 2020, 9:13pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/17 "2020-09-01T21:13:14Z")

</div>

Hi @ruhanga,

I don’t think we have any formal documentation currently on how OpenELIS interacts with Fhir. However, the main workflow that uses it was documented by a team that we were interfacing with located at [https://wiki.openmrs.org/display/projects/Lab+Integration+Workflow](https://wiki.openmrs.org/display/projects/Lab+Integration+Workflow). The class that deals with this workflow on our side is `FhirApiWorkFlowServiceImpl.java`. One correction I would make to that document is that the remote application does not initiate the sending of resources to OE. As you can see in `FhirApiWorkFlowServiceImpl.java`, OE polls for remote tasks from the remote application and searches for Tasks that OE is the “owner” of. It then also grabs any attached Service Requests and Patients before proceeding.

Currently the way OpenELIS operates is that there are 2 servers running: OpenELIS-Global and Hapi-Fhir-Jpaserver. When OE creates an OE patient, it also contacts the jpaserver and tells it to create a FHIR patient. When a patient is created directly in the JPAserver, OE doesn’t do anything to process it. Because of this, all fhir resources are expected to be created by/through OE.

Search/read functionality should work completely through solely the JPA Server and is well documented at [https://www.hl7.org/fhir/search.html](https://www.hl7.org/fhir/search.html). Our copy of the JPA Server is currently configured to require clientauth so if you are interacting with it you will need to make sure you have a client cert that is in its truststore or disable the clientauth.

---

<div class="post-metadata">

**Author:** ![mksrom](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mksrom/32/21_2.png) [@mksrom](https://talk.openelis-global.org/u/mksrom)\
**Post date:** [September 2, 2020, 7:52am UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/18 "2020-09-02T07:52:17Z")

</div>

> [@calebslane](#):
>
> When OE creates an OE patient, it also contacts the jpaserver and tells it to create a FHIR patient

So there seem to be 2 places where patients are saved: the OE database and the HAPI-FHIR database.

Isn’t the HAPI-FHIR back-end sufficient to store patients?

---

<div class="post-metadata">

**Author:** ![calebslane](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/calebslane/32/330_2.png) [@calebslane](https://talk.openelis-global.org/u/calebslane)\
**Post date:** [September 2, 2020, 9:21pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/19 "2020-09-02T21:21:47Z")

</div>

@mksrom That is correct.

Yes, ideally we would just use the FHIR patient for persistence, and in fact use FHIR concepts for all our entities. However, since OpenELIS had it’s own data model prior to starting the FHIR integration and because we had limited time/resources before the FHIR compliance was needed, we weren’t able to map our concepts to FHIR ones.

---

<div class="post-metadata">

**Author:** ![arun.mitteam](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@arun.mitteam](https://talk.openelis-global.org/u/arun.mitteam)\
**Post date:** [December 12, 2020, 10:42pm UTC](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17/20 "2020-12-12T22:42:42Z")

</div>

My goal is to customize the patient registration page.  
Followed this thread to do local workspace setup and running into a different error -  
The dataexportservice doesn’t have the method. What am I missing here?

```
 openelisglobal: Compilation failure
[ERROR] /Users/arun/Projects/OpenELIS-Global-2/src/main/java/org/openelisglobal/dataexchange/fhir/controller/FhirExportController.java:[26,30] cannot find symbol
[ERROR] symbol: method exportNewDataFromLocalToRemote(org.itech.fhir.dataexport.core.model.DataExportTask)
[ERROR] location: variable dataExportService of type org.itech.fhir.dataexport.api.service.DataExportService
```

[Next page](https://talk.openelis-global.org/t/how-to-run-openelis-from-source-code/17.md?page=2)
