-
make sure java and sbt environment variables are set
-
fork the repository to your GitHub account
-
clone the repository
git clone https://github.com/yourusername/femr.git
-
clean, compile, and test the project
sbt clean compile test
- Install Plugin: Scala
- File -> Import
- Select the femr folder, click next
- Select 'Import project from external model'
- Select 'SBT'
- Click Next
- Select 'Use auto-import'
- Ensure the Project SDK is java version 1.8, click finish
- If asked to select modules/data, select fEMR(root module) and fEMR-build.
- Create a file named application.dev.conf in the conf folder, copy and paste the information from application.example.conf in it. Change the information to match your database, username, and password.
- Create a database in mySQL with the same name as the database in the connection string inside of application.dev.conf
- Under Run, select Edit configurations. Create a new Play 2.0 application and add the following environment variables using your absolute filepath to the file: [config.file // /absolute/location/to/conf/application.dev.conf] [user.dir // /absolute/location/to/femr]
- Run
- Contact [email protected] for an IntelliJ IDEA liscense key or with any issues configuring IntelliJ.
Unless you are working on a bug in a specific release, always create a branch from master. Each JIRA issue should have its own branch. JIRA issues have 4 categories. To create a working branch before working on an issue:
- features:
git checkout master
git checkout -b feature-[JIRA_ID]-[briefDescriptionOfFeature]
- bugs:
git checkout master
git checkout -b bug-[JIRA_ID]-[briefDescriptionOfBug]
- improvements:
git checkout master
git checkout -b improvement-[JIRA_ID]-[briefDescriptionOfImprovement]
- tasks:
git checkout master
git checkout -b task-[JIRA_ID]-[briefDescriptionOfTask]
Example:
git checkout -b feature-FEMR832-fixingEverythingEverywhere
Always sync your fork's (username/femr) master branch with the project's (femr/femr) master branch. If your working branch begins to deviate too far from master, merging will becoming increasingly difficult. This ensures that your work remains in sync with everyone else's work:
- List your current remotes to see if you have one pointing upstream to the main project repository (femr/femr):
git remote -v
- If you do not, add one:
git remote add upstream https://github.com/femr/femr.git
- Sync your updated local master branch with your fork's master branch:
git checkout master
git pull upstream master
git push origin master
If you have committed your work to master, you will run into issues here. Move your work to a separate working branch and get a fresh copy of the master branch.
-
This step requires rebasing. Sync your working branch with your fork and rebase new code into your working branch: git checkout [issueBranchName] git push origin [issueBranchName] git rebase master
-
After confirming your code was properly merged and that the rebase was successful, sync the new branch with your fork: git checkout [issueBranchName] git push -f origin [issueBranchName]
Note the '-f' option for push in Step 5. This forces a push because the rebase has altered your commit history. Anyone else that was using your branch will need to delete it and pull down a fresh copy.
Submit your code for review to be accepted into the main project repository (femr/femr) by sending a Pull Request from your fork on GitHub:
-
Update your branch with the newest code by syncing master and then rebasing your working branch. See Step 4 and Step 5 in the previous section to complete this.
-
Initiating a pull request:
Initiate a pull request from your fork's (username/femr) working branch into the main repository's (femr/femr) master branch.
-
If your Pull Request is Accepted git checkout master git pull upstream master
-
If your Pull Request requires additional commits you can add them to your branch and push to your fork. They will automatically be updated in the Pull Request.
git checkout [issueBranchName]
~~~make changes, commit them~~~
git push origin [issueBranchName]
- If your Pull Request is Rejected
git checkout master
git pull upstream master
git checkout [issueBranchName]
git rebase master
~~~fix issues~~~
git checkout master
git pull upstream master
git checkout [issueBranchName]
git rebase master
git push -f origin [issueBranchName]
- Delete your branch locally:
git branch -d [issueBranchName]
- Delete your branch from your fork:
git push origin :[issueBranchName]