fhirmapping
v1.0.0
Published
Describes the implementation of FHIR Mapping Language. It is necessary to trnasfer FHIR resources from one version of FHIR standart to another.
Downloads
3
Readme
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