Code Monkey home page Code Monkey logo

synthea_query's Introduction

Build and Test

Requirement:

  1. PostgreSQL are installed somewhere.

Task 1

  1. Put the SQL files into the code folder.

  2. Import the generated synthetic data into the database:

psql -U your_super_user_name -f dump-synthea-202212120538.sql

This SQL is exported from the PostgreSQL database. The data inside is generated using Synthea 2.7.0 and imported using the ETL tool provided in the reference. The data is generated using the following command (no need to run this):

java -jar .\synthea-with-dependencies.jar -s 12 -p 100 --exporter.csv.export true
  1. Create 2 users: user1 and readonly:
psql -U your_super_user_name -d synthea -f create_user.sql
  1. Create a query using table joins and where clause:
psql -U your_super_user_name -d synthea -f create_query.sql

Inside the SQL files there are explanations and optimizations of the query.

Task 2

  1. Install relevant dependencies
pip install -r requirements.txt
  1. Setup environment variables for PostgreSQL, for example:
export synthea_user=test synthea_password=test synthea_host=localhost synthea_port=5432 synthea_database=synthea
  1. Run main.py and get test results
python main.py
  1. To run unit tests:
python -m unittest tests.test_main

Task 3

The github repository is here: https://github.com/wanghewen/synthea_query

synthea_query's People

Contributors

wanghewen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.