GithubHelp home page GithubHelp logo

c0elh0 / fhir-universal-conversion-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lorex/fhir-universal-conversion-kit

1.0 0.0 0.0 403 KB

FHIR Universal Conversion Kit (F.U.C.K.) is a conversion kit that can convert albitary data to HL7 FHIR data.

License: Other

JavaScript 100.00%

fhir-universal-conversion-kit's Introduction

FHIR Universal Conversion Kit (Project F.U.C.K)

FHIR Universal Conversion Kit (F.U.C.K.) is a super awesome and sexy kit that can convert albitary data to HL7 FHIR data.

TODO

  • ✅ Core Engine
  • ✅ Multipule Profile (Config File) Support
  • ✅ Data Preprocessor
  • ✅ FHIR Data Uploader
  • ➡️ FHIR Profile Validator

Requirements

  • node.js 16.8.0

Installation

Clone this repository to your computer

$ git clone https://github.com/Lorex/FHIR-Universal-Conversion-Kit.git

Install npm packages

$ cd src
$ npm install

Install npm packages

$ cd src
$ npm install

Run Service

$ chmod +x ./start_server
$ ./start_server

API

Server will default listen on port 1337.

API Endpoint

POST <serverurl>

Payload

{
    "profile": "<Profile Name>",
    "data": [
        "Source Data",
    ]
}

Response

{
    "success": true,
    "data": [
        "Response Data"
    ]
}

Profile

If you have many different data source formats, you can create separate profiles (also known as config files) for each of them. Each profile can define different data sources, source fields, conversion rules, and preprocessors.

ATTENTION: The 'Profile' in this section is NOT FHIR Profile

Every source data will be processed and converted as the following workflow:

workflow

To define a profile, just create <profileName>.js in the profile folder simply, the server should automatically load all profiles at the start.

This is an example of the profile:

module.exports.profile = {
    // Name of the profile
    name: 'example',

    // version of the profile
    version: '1.0.0',

    // The base URL of the FHIR server, this field will affect the 'fullUrl' element in the generated bundle.
    fhirServerBaseUrl: 'https://hapi.fhir.tw/fhir',     // 

    // Whether should we do after conversion?
    // 'upload': Upload the converted data to the FHIR server and return the server response.
    // 'return': Don't upload, just return the converted data.
    action: 'upload',
}

module.exports.globalResource = {
    // Should be resource name
    Patient: {
        // Defile resource template here
        active: true
        
        // If you want to reference to other resource of this bundle automatically, use '{ reference: #<ResourceType> }'
        managingOrganization: {
            reference: '#Organization',
        }
    },
    Practitioner: {
        active: true,
    },
}

// Global Preprocessor Hook
// Data will run the following function before we iterate each fields
module.exports.beforeProcess = (data) => {
    // Do something
    return data
}

// Define your fields and conversion rules here
module.exports.fields = [
    {
        // Field name of the source data
        source: 'pname',

        // Target element of FHIR resource which source data will converted to
        target: 'Patient.id',

        // Field preprocessor hook before we convert the source data
        beforeConvert: (data) => {
            return `pat-test2-${data}`
        }
    }
]

fhir-universal-conversion-kit's People

Contributors

lorex avatar lorexyang avatar

Stargazers

 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.