Coder Social home page Coder Social logo

his_sync's Introduction

Objective:

To synchronize Flask database with the data from the HIS. Schema and sample data will be provided below....

Assumption:

* no changes can be made on the HIS side
* HIS db server could be accessable thought internet
* HIS side has no API to fetch the records but SQL query is applicable
* HIS side db is SQLAlchemy compatible like Postgres/MySql/Sqlite. In this exmaple another Postgres instance was used

Setup:

  • Project Directory: his_sync
  • Docker: docker folder
  • Flask app: app.py
  • Bluprint app: sync/sync.py

Directory structure: . ├── README.md ├── app.py ├── config.py ├── conn.py ├── docker │   ├── Dockerfile │   ├── docker-compose.yml │   ├── his_data.sql │   └── requirements.txt └── sync ├── init.py ├── model.py ├── sync.py └── templates └── home.html

Docker:

* Please follow below steps 

  1. pgdb >> Flask app db:
      - port: 5432

  2. pgdb2 >> HIS side db:
      - port: 5434

  3. adminer >> for db navigation:
      - access >> 127.0.0.1:8080
      - login to pgdb2 (server: pgdb2,  user: postgres, password: His123)
      - open his_db
      - create table from sql command: file attached <his_db.sql>

  4. app >> For flask app: 
      - port: 5000
      - access path: 127.0.0.1:5000/sync


Environment build steps:

1. cd his_sync/docker
2. docker-compose up --build
3. db setup [Docker step 3]
4. open browser > 127.0.0.1:5000/sync [If above steps works fine you will get synchorization interface]

Comments:

No policy was taken to change in HIS side. This given codes have been built only for quick challenge accomplishment but not for real life production version. It needs more work to make it more efficient in production version.

his_sync's People

Contributors

iqbalalo avatar

Watchers

 avatar James Cloos 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.