npm.io
1.0.0 • Published 7 years ago

fhirmapping

Licence
ISC
Version
1.0.0
Deps
3
Size
34 kB
Vulns
0
Weekly
0

FHIR Mapping Language

Describes the implementation of FHIR Mapping Language. It is necessary to trnasfer FHIR resources from one version of FHIR standart to another.

The main part of implementation is mappingEngine.js

The engine works automatically. It receives a transformation map as input and applies it to the old version of the resource.

The code snippet is shown below.

//JavaScript code

        switch(operation){
        case 'move':
            setElement(newPathFromMap, saveResource, elementFromPath);
            deepDelete(oldPathFromMap, saveResource);
            break;
        case 'add':
            setElement(newPathFromMap, saveResource, {});
            break;
        default:
            new Error('Operations are not find!');
        }
    }

How it works

Example

Снимок экрана от 2019-06-19 13-59-58