|
| 1 | +<!DOCTYPE html> |
| 2 | +<!-- |
| 3 | + | Generated by Apache Maven Doxia Site Renderer 1.7.4 at 2017-06-23 |
| 4 | + | Rendered using Apache Maven Fluido Skin 1.6 |
| 5 | +--> |
| 6 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 7 | + <head> |
| 8 | + <meta charset="UTF-8" /> |
| 9 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 10 | + <meta name="Date-Revision-yyyymmdd" content="20170623" /> |
| 11 | + <meta http-equiv="Content-Language" content="en" /> |
| 12 | + <title>HAPI – </title> |
| 13 | + <link rel="stylesheet" href="./css/apache-maven-fluido-1.6.min.css" /> |
| 14 | + <link rel="stylesheet" href="./css/site.css" /> |
| 15 | + <link rel="stylesheet" href="./css/print.css" media="print" /> |
| 16 | + <script type="text/javascript" src="./js/apache-maven-fluido-1.6.min.js"></script> |
| 17 | + </head> |
| 18 | + <body class="topBarDisabled"> |
| 19 | + <div class="container-fluid"> |
| 20 | + <div id="banner"> |
| 21 | + <div class="pull-left"><a href="https://hapifhir.github.io/hapi-hl7v2" id="bannerLeft"><img src="images/hapi_banner.png" alt="HAPI"/></a></div> |
| 22 | + <div class="pull-right"></div> |
| 23 | + <div class="clear"><hr/></div> |
| 24 | + </div> |
| 25 | + |
| 26 | + <div id="breadcrumbs"> |
| 27 | + <ul class="breadcrumb"> |
| 28 | + <li id="publishDate">Last Published: 2017-06-23<span class="divider">|</span> |
| 29 | +</li> |
| 30 | + <li id="projectVersion">Version: 2.3</li> |
| 31 | + <li class="pull-right"><span class="divider">|</span> |
| 32 | +<a href="http://www.uhn.ca/" class="externalLink" title="University Health Network">University Health Network</a></li> |
| 33 | + <li class="pull-right"><span class="divider">|</span> |
| 34 | +<a href="http://hl7.org/" class="externalLink" title="hl7.org">hl7.org</a></li> |
| 35 | + <li class="pull-right"><a href="https://github.com/hapifhir/hapi-hl7v2" class="externalLink" title="GitHub Project Page">GitHub Project Page</a></li> |
| 36 | + </ul> |
| 37 | + </div> |
| 38 | + <div class="row-fluid"> |
| 39 | + <div id="leftColumn" class="span2"> |
| 40 | + <div class="well sidebar-nav"> |
| 41 | +<ul class="nav nav-list"> |
| 42 | + <li class="nav-header">Welcome</li> |
| 43 | + <li><a href="index.html" title="Introduction"><span class="none"></span>Introduction</a> </li> |
| 44 | + <li><a href="changes-report.html" title="Changelog"><span class="none"></span>Changelog</a> </li> |
| 45 | + <li><a href="https://smilecdr.com/blog/" class="externalLink" title="Blog"><span class="none"></span>Blog</a> </li> |
| 46 | + <li class="nav-header">FHIR</li> |
| 47 | + <li><a href="hapi-fhir/" title="HAPI FHIR"><span class="none"></span>HAPI FHIR</a> </li> |
| 48 | + <li class="nav-header">Tools</li> |
| 49 | + <li><a href="hapi-testpanel/index.html" title="TestPanel"><span class="none"></span>TestPanel</a> </li> |
| 50 | + <li><a href="hapi-hl7overhttp/index.html" title="HL7 over HTTP"><span class="none"></span>HL7 over HTTP</a> </li> |
| 51 | + <li><a href="colouriser.html" title="Colouriser"><span class="none"></span>Colouriser</a> </li> |
| 52 | + <li class="nav-header">Download</li> |
| 53 | + <li><a href="https://sourceforge.net/projects/hl7api/files/hl7api/" class="externalLink" title="Download Java API"><span class="none"></span>Download Java API</a> </li> |
| 54 | + <li><a href="hapi-testpanel/install.html" title="Download TestPanel"><span class="none"></span>Download TestPanel</a> </li> |
| 55 | + <li class="nav-header">Documentation</li> |
| 56 | + <li><a href="getting_started.html" title="Getting Started"><span class="none"></span>Getting Started</a> </li> |
| 57 | + <li><a href="devbyexample.html" title="HAPI By Example"><span class="none"></span>HAPI By Example</a> </li> |
| 58 | + <li><a href="base/apidocs/index.html" title="JavaDoc (API core)"><span class="icon-chevron-down"></span>JavaDoc (API core)</a> |
| 59 | + <ul class="nav nav-list"> |
| 60 | + <li><a href="v21/apidocs/index.html" title="v2.1 Messages"><span class="none"></span>v2.1 Messages</a> </li> |
| 61 | + <li><a href="v22/apidocs/index.html" title="v2.2 Messages"><span class="none"></span>v2.2 Messages</a> </li> |
| 62 | + <li><a href="v23/apidocs/index.html" title="v2.3 Messages"><span class="none"></span>v2.3 Messages</a> </li> |
| 63 | + <li><a href="v231/apidocs/index.html" title="v2.3.1 Messages"><span class="none"></span>v2.3.1 Messages</a> </li> |
| 64 | + <li><a href="v24/apidocs/index.html" title="v2.4 Messages"><span class="none"></span>v2.4 Messages</a> </li> |
| 65 | + <li><a href="v25/apidocs/index.html" title="v2.5 Messages"><span class="none"></span>v2.5 Messages</a> </li> |
| 66 | + <li><a href="v251/apidocs/index.html" title="v2.5.1 Messages"><span class="none"></span>v2.5.1 Messages</a> </li> |
| 67 | + <li><a href="v26/apidocs/index.html" title="v2.6 Messages"><span class="none"></span>v2.6 Messages</a> </li> |
| 68 | + <li><a href="v27/apidocs/index.html" title="v2.7 Messages"><span class="none"></span>v2.7 Messages</a> </li> |
| 69 | + <li><a href="v28/apidocs/index.html" title="v2.8 Messages"><span class="none"></span>v2.8 Messages</a> </li> |
| 70 | + <li><a href="v281/apidocs/index.html" title="v2.8.1 Messages"><span class="none"></span>v2.8.1 Messages</a> </li> |
| 71 | + </ul> |
| 72 | + </li> |
| 73 | + <li><a href="xref/index.html" title="Source XRef"><span class="none"></span>Source XRef</a> </li> |
| 74 | + <li><a href="hapi-faq.html" title="FAQ"><span class="none"></span>FAQ</a> </li> |
| 75 | + <li><a href="conformance.html" title="Conformance Tools"><span class="none"></span>Conformance Tools</a> </li> |
| 76 | + <li><a href="hapi-sourcegen/confgen-usage.html" title="Maven Plugins"><span class="none"></span>Maven Plugins</a> </li> |
| 77 | + <li class="nav-header">Get Help</li> |
| 78 | + <li><a href="mail-lists.html" title="Mailing List"><span class="none"></span>Mailing List</a> </li> |
| 79 | + <li class="nav-header">Contribute</li> |
| 80 | + <li class="active"><a href="#"><span class="none"></span>Hacking HAPI</a> |
| 81 | + </li> |
| 82 | + <li><a href="submissions.html" title="Submitting Code"><span class="none"></span>Submitting Code</a> </li> |
| 83 | + <li><a href="issue-tracking.html" title="Issue Tracking"><span class="none"></span>Issue Tracking</a> </li> |
| 84 | + <li><a href="source-repository.html" title="Source Code"><span class="none"></span>Source Code</a> </li> |
| 85 | + <li class="nav-header">Reports</li> |
| 86 | + <li><a href="team-list.html" title="HAPI Developers"><span class="none"></span>HAPI Developers</a> </li> |
| 87 | + <li><a href="surefire-report.html" title="Unit Test Report"><span class="none"></span>Unit Test Report</a> </li> |
| 88 | + <li><a href="taglist.html" title="Source Tag List"><span class="none"></span>Source Tag List</a> </li> |
| 89 | + <li><a href="cobertura/index.html" title="Cobertura"><span class="none"></span>Cobertura</a> </li> |
| 90 | + <li><a href="findbugs.html" title="FindBugs"><span class="none"></span>FindBugs</a> </li> |
| 91 | + <li><a href="license.html" title="License"><span class="none"></span>License</a> </li> |
| 92 | + <li class="nav-header">Older Documentation</li> |
| 93 | + <li><a href="parsing.html" title="Parsing Messages"><span class="none"></span>Parsing Messages</a> </li> |
| 94 | + <li><a href="installation.html" title="Installation"><span class="none"></span>Installation</a> </li> |
| 95 | + <li><a href="links.html" title="Helpful Links"><span class="none"></span>Helpful Links</a> </li> |
| 96 | + </ul> |
| 97 | + <hr /> |
| 98 | + <div id="poweredBy"> |
| 99 | + <div class="clear"></div> |
| 100 | + <div class="clear"></div> |
| 101 | + <div class="clear"></div> |
| 102 | + <div class="clear"></div> |
| 103 | + <a href="http://maven.apache.org" title="Built with Maven 2" class="builtBy"><img class="builtBy" alt="Built with Maven 2" src="images/logos/maven-feather.png" /></a> |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + <div id="bodyColumn" class="span10" > |
| 108 | +<div class="section"> |
| 109 | +<h2><a name="Hacking_HAPI"></a>Hacking HAPI</h2> |
| 110 | +<p>This page explains all of the steps neccesary to work with the actual source code for HAPI. This might be done for example to fix bugs, add features, or learn how HAPI works internally. </p> |
| 111 | +<p>As of version 0.6, HAPI uses the <a class="externalLink" href="./http://maven.apache.org">Maven</a> build system to build it's source code. Generating the source takes the following steps.</p> |
| 112 | +<div class="section"> |
| 113 | +<h3><a name="Getting_the_Source"></a>Getting the Source</h3> |
| 114 | +<p>The first step to building HAPI is obtaining the source code. HAPI uses CVS as its <a href="./source-repository.html">source-code repository</a>.</p> |
| 115 | +<p>Note that the correct subdirectory to check out from the repository is now called "hapi-mvn". There is an outdated directory called "hapi" which is kept only for reference.</p> |
| 116 | +<p>If you are using Eclipse to check the project out, the project may show errors when you first check it out. These will be resolved by running through the build using Maven.</p></div> |
| 117 | +<div class="section"> |
| 118 | +<h3><a name="Understanding_the_Project_Structure"></a>Understanding the Project Structure</h3> |
| 119 | +<p>HAPI is now broken up into several subprojects:</p> |
| 120 | +<table border="0" class="table table-striped"> |
| 121 | +<tr class="a"> |
| 122 | +<td align="left">hapi-base</td> |
| 123 | +<td align="left">This is the core of the HAPI library. It contains things such as parsers, transport, validation, etc. If you are making changes to HAPI itself, this is probably where you want to start.</td></tr> |
| 124 | +<tr class="b"> |
| 125 | +<td align="left">hapi-sourcegen</td> |
| 126 | +<td align="left">This project is used to generate message libraries. It is only used at build time.</td></tr> |
| 127 | +<tr class="a"> |
| 128 | +<td align="left">hapi-structures-vXX</td> |
| 129 | +<td align="left">These projects contain the libraries used to generate and process individual messages for a specific version of HL7. They are generated using the proprietary HL7 database provided by HL7.org, and so are usually not modified by end users of the HAPI library.</td></tr> |
| 130 | +<tr class="b"> |
| 131 | +<td align="left">hapi-examples</td> |
| 132 | +<td align="left">This project provides several annotated examples of how to use HAPI.</td></tr> |
| 133 | +<tr class="a"> |
| 134 | +<td align="left">hapi-test</td> |
| 135 | +<td align="left">This project contains unit tests for the HAPI library</td></tr></table></div> |
| 136 | +<div class="section"> |
| 137 | +<h3><a name="Install_the_build_tools"></a>Install the build tools</h3> |
| 138 | +<p>Download the latest version of <a class="externalLink" href="http://maven.apache.org">Maven</a>. The download page also has instructions for installing Maven correctly.</p></div> |
| 139 | +<div class="section"> |
| 140 | +<h3><a name="Building_HAPI"></a>Building HAPI</h3> |
| 141 | +<p>Building a HAPI base JAR is as simple as typing:</p> |
| 142 | +<div class="source"><pre class="prettyprint">mvn install</pre></div> |
| 143 | +<p>At the end of this build, you should have a compiled JAR in the following subdirectory:</p> |
| 144 | +<div class="source"><pre class="prettyprint">[workspace]/hapi-mvn/hapi-base/target/hapi-base-VERSION.jar</pre></div></div> |
| 145 | +<div class="section"> |
| 146 | +<h3><a name="Set_up_Eclipse"></a>Set up Eclipse</h3> |
| 147 | +<p>Once Maven has been run for the first time, you will need to define an Eclipse classpath variable pointing to your local maven repository.</p> |
| 148 | +<ul> |
| 149 | +<li>First, find your local Maven repository. It will be a directory called ".m2/repository" in your home directory. So, for a user named "james", it would be in the following location, depending on OS: |
| 150 | +<table border="0" class="table table-striped"> |
| 151 | +<tr class="a"> |
| 152 | +<td align="left">Windows XP</td> |
| 153 | +<td align="left">C: Documents and Settings James .m2 repository</td></tr> |
| 154 | +<tr class="b"> |
| 155 | +<td align="left">Windows Vista</td> |
| 156 | +<td align="left">C: Users James .m2 repository</td></tr> |
| 157 | +<tr class="a"> |
| 158 | +<td align="left">Linux</td> |
| 159 | +<td align="left">/home/james/.m2/repository</td></tr></table></li> |
| 160 | +<li>Next, in Eclipse, open the Preferences dialogue (in the Window menu).</li> |
| 161 | +<li>Navigate to the following section: Java -> Build Path -> Classpath Variables</li> |
| 162 | +<li>Click on "New"</li> |
| 163 | +<li>For "Name", enter "M2_REPO"</li> |
| 164 | +<li>For "Path", enter the path to the local repo. eg: "C:\Users\James\.m2\repository"</li></ul></div> |
| 165 | +<div class="section"> |
| 166 | +<h3><a name="Tips_and_tricks"></a>Tips and tricks</h3> |
| 167 | +<p>To skip running the unit tests, execute the following:</p> |
| 168 | +<div class="source"><pre class="prettyprint">mvn -Dmaven.test.skip -P CORE install</pre></div></div></div> |
| 169 | + </div> |
| 170 | + </div> |
| 171 | + </div> |
| 172 | + <hr/> |
| 173 | + <footer> |
| 174 | + <div class="container-fluid"> |
| 175 | + <div class="row-fluid"> |
| 176 | + <p>Copyright ©2001–2017 |
| 177 | +<a href="http://www.uhn.ca">University Health Network</a>. |
| 178 | +All rights reserved.</p> |
| 179 | + </div> |
| 180 | + </div> |
| 181 | + </footer> |
| 182 | + <script type="text/javascript"> |
| 183 | + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| 184 | + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| 185 | + </script> |
| 186 | + <script type="text/javascript"> |
| 187 | + try { |
| 188 | + var pageTracker = _gat._getTracker("UA-1395874-1"); |
| 189 | + pageTracker._trackPageview(); |
| 190 | + } catch(err) {}</script> |
| 191 | + </body > |
| 192 | +</html> |
0 commit comments