Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Utility to Load Synthea CSV data to OMOP CDM • ETLSyntheaBuilder</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="bootstrap-toc.css"><script src="bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet"><script src="pkgdown.js"></script><meta property="og:title" content="Utility to Load Synthea CSV data to OMOP CDM"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--></head><body data-spy="scroll" data-target="#toc">
    

    <div class="container template-title-body">
      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand">
        <a class="navbar-link" href="index.html">ETLSyntheaBuilder</a>
        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.0</span>
      </span>
    </div>

    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav"><li>
  <a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
    Articles
     
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" role="menu"><li>
      <a href="articles/Condition_occurrence.html">Condition_occurrence</a>
    </li>
    <li>
      <a href="articles/Drug_exposure.html">Drug_exposure</a>
    </li>
    <li>
      <a href="articles/Measurement.html">Measurement</a>
    </li>
    <li>
      <a href="articles/observation.html">Observation</a>
    </li>
    <li>
      <a href="articles/observation_period.html">Observation_period</a>
    </li>
    <li>
      <a href="articles/person.html">Person</a>
    </li>
    <li>
      <a href="articles/procedure_occurrence.html">Procedure_occurrence</a>
    </li>
    <li>
      <a href="articles/visit_occurrence.html">Visit Occurrence</a>
    </li>
  </ul></li>
      </ul><ul class="nav navbar-nav navbar-right"></ul></div><!--/.nav-collapse -->
  </div><!--/.container -->
</div><!--/.navbar -->

      

      </header><div class="row">
  <div class="contents col-md-9">
    <div class="page-header">
      <h1>Utility to Load Synthea CSV data to OMOP CDM</h1>
    </div>

<div id="utility-to-load-synthea-csv-data-to-omop-cdm" class="section level1">

<div class="section level2">
<h2 id="currently-supports-cdm-v53-and-v54">Currently supports CDM v5.3 and v5.4<a class="anchor" aria-label="anchor" href="#currently-supports-cdm-v53-and-v54"></a></h2>
<p>Follow the steps on the <a href="https://github.com/synthetichealth/synthea/wiki" class="external-link">synthea wiki</a> to run the program and generate the files. This builder works off of the csv files, not the fhir files. To do this the <code>exporter.csv.export</code> option in the <code>./src/main/resources/synthea.properties</code> file needs to be set to TRUE.</p>
<div class="section level3">
<h3 id="step-by-step-example">Step by Step Example<a class="anchor" aria-label="anchor" href="#step-by-step-example"></a></h3>
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
<code class="sourceCode R"> <span class="fu">devtools</span><span class="fu">::</span><span class="fu"><a href="https://devtools.r-lib.org/reference/remote-reexports.html" class="external-link">install_github</a></span><span class="op">(</span><span class="st">"OHDSI/ETL-Synthea"</span><span class="op">)</span>

 <span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va">ETLSyntheaBuilder</span><span class="op">)</span>

 <span class="co"># We are loading a version 5.4 CDM into a local PostgreSQL database called "synthea10".</span>
 <span class="co"># The ETLSyntheaBuilder package leverages the OHDSI/CommonDataModel package for CDM creation.</span>
 <span class="co"># Valid CDM versions are determined by executing CommonDataModel::listSupportedVersions().</span>
 <span class="co"># The strings representing supported CDM versions are currently "5.3" and "5.4". </span>
 <span class="co"># The Synthea version we use in this example is 2.7.0.  Since Synthea's MASTER branch is always active, we currently</span>
 <span class="co"># only support version 2.7.0.</span>
 <span class="co"># The schema to load the Synthea tables is called "native".</span>
 <span class="co"># The schema to load the Vocabulary and CDM tables is "cdm_synthea10".  </span>
 <span class="co"># The username and pw are "postgres" and "lollipop".</span>
 <span class="co"># The Synthea and Vocabulary CSV files are located in /tmp/synthea/output/csv and /tmp/Vocabulary_20181119, respectively.</span>
 
 <span class="co"># For those interested in seeing the CDM changes from 5.3 to 5.4, please see: http://ohdsi.github.io/CommonDataModel/cdm54Changes.html</span>
 
<span class="va">cd</span> <span class="op">&lt;-</span> <span class="fu">DatabaseConnector</span><span class="fu">::</span><span class="fu"><a href="https://ohdsi.github.io/DatabaseConnector/reference/createConnectionDetails.html" class="external-link">createConnectionDetails</a></span><span class="op">(</span>
  dbms     <span class="op">=</span> <span class="st">"postgresql"</span>, 
  server   <span class="op">=</span> <span class="st">"localhost/synthea10"</span>, 
  user     <span class="op">=</span> <span class="st">"postgres"</span>, 
  password <span class="op">=</span> <span class="st">"lollipop"</span>, 
  port     <span class="op">=</span> <span class="fl">5432</span>, 
  pathToDriver <span class="op">=</span> <span class="st">"d:/drivers"</span>  
<span class="op">)</span>

<span class="va">cdmSchema</span>      <span class="op">&lt;-</span> <span class="st">"cdm_synthea10"</span>
<span class="va">cdmVersion</span>     <span class="op">&lt;-</span> <span class="st">"5.4"</span>
<span class="va">syntheaVersion</span> <span class="op">&lt;-</span> <span class="st">"2.7.0"</span>
<span class="va">syntheaSchema</span>  <span class="op">&lt;-</span> <span class="st">"native"</span>
<span class="va">syntheaFileLoc</span> <span class="op">&lt;-</span> <span class="st">"/tmp/synthea/output/csv"</span>
<span class="va">vocabFileLoc</span>   <span class="op">&lt;-</span> <span class="st">"/tmp/Vocabulary_20181119"</span>

<span class="fu">ETLSyntheaBuilder</span><span class="fu">::</span><span class="fu"><a href="reference/CreateCDMTables.html">CreateCDMTables</a></span><span class="op">(</span>connectionDetails <span class="op">=</span> <span class="va">cd</span>, cdmSchema <span class="op">=</span> <span class="va">cdmSchema</span>, cdmVersion <span class="op">=</span> <span class="va">cdmVersion</span><span class="op">)</span>
                                     
<span class="fu">ETLSyntheaBuilder</span><span class="fu">::</span><span class="fu"><a href="reference/CreateSyntheaTables.html">CreateSyntheaTables</a></span><span class="op">(</span>connectionDetails <span class="op">=</span> <span class="va">cd</span>, syntheaSchema <span class="op">=</span> <span class="va">syntheaSchema</span>, syntheaVersion <span class="op">=</span> <span class="va">syntheaVersion</span><span class="op">)</span>
                                       
<span class="fu">ETLSyntheaBuilder</span><span class="fu">::</span><span class="fu"><a href="reference/LoadSyntheaTables.html">LoadSyntheaTables</a></span><span class="op">(</span>connectionDetails <span class="op">=</span> <span class="va">cd</span>, syntheaSchema <span class="op">=</span> <span class="va">syntheaSchema</span>, syntheaFileLoc <span class="op">=</span> <span class="va">syntheaFileLoc</span><span class="op">)</span>
                                     
<span class="fu">ETLSyntheaBuilder</span><span class="fu">::</span><span class="fu"><a href="reference/LoadVocabFromCsv.html">LoadVocabFromCsv</a></span><span class="op">(</span>connectionDetails <span class="op">=</span> <span class="va">cd</span>, cdmSchema <span class="op">=</span> <span class="va">cdmSchema</span>, vocabFileLoc <span class="op">=</span> <span class="va">vocabFileLoc</span><span class="op">)</span>
                                    
<span class="fu">ETLSyntheaBuilder</span><span class="fu">::</span><span class="fu"><a href="reference/LoadEventTables.html">LoadEventTables</a></span><span class="op">(</span>connectionDetails <span class="op">=</span> <span class="va">cd</span>, cdmSchema <span class="op">=</span> <span class="va">cdmSchema</span>, syntheaSchema <span class="op">=</span> <span class="va">syntheaSchema</span>, cdmVersion <span class="op">=</span> <span class="va">cdmVersion</span>, syntheaVersion <span class="op">=</span> <span class="va">syntheaVersion</span><span class="op">)</span></code></pre></div>
</div>
<div class="section level3">
<h3 id="simulating-data-with-synthea">Simulating Data with Synthea<a class="anchor" aria-label="anchor" href="#simulating-data-with-synthea"></a></h3>
<p>For commented code used to convert the Synthea data see extras/codeToRun.R</p>
<p>For more information on Synthea visit: <a href="https://synthetichealth.github.io/synthea/" class="external-link uri">https://synthetichealth.github.io/synthea/</a></p>
<p>Get Synthea from GitHub: <a href="https://github.com/synthetichealth/synthea" class="external-link uri">https://github.com/synthetichealth/synthea</a></p>
</div>
</div>
</div>

  </div>

  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
    <nav id="toc" data-toggle="toc" class="sticky-top"><h2 data-toc-skip>Contents</h2>
    </nav></div>

</div>



      <footer><div class="copyright">
  <p></p><p>Developed by Anthony Molinaro.</p>
</div>

<div class="pkgdown">
  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.0.</p>
</div>

      </footer></div>

  


  

  </body></html>