@artezio/fhir-converter

1.0.8 • Public • Published

artezio/fhir-converter

It's a mapper designed to convert json models from fhire format to @artezio/models and back.

Installation

with npm

$ npm install @artezio/models

with yarn

$ yarn add @artezio/models

 

Usage

import { questionnaireConverter } from '@artezio/fhir-converter';
import { service } from 'some FHIR service';

const myFHIRModel = service.getQuestionnaire();// fetching fhir model in json

const myQuestionnaireModel = questionnaireConverter.toModel(myFHIRModel);//json object

You can put myQuestionnaireModel to Questionnaire constructor from @artezio/models to make a model;

Then you can do manipulations with model in your code and convert it back:

const myNewFHIRModel = questionnaireConverter.fromModel(myQuestionnaireModel);
service.putQuestionnaire(myNewFHIRModel);

The same behavior with questionnaireResponseConverter.

Readme

Keywords

none

Package Sidebar

Install

npm i @artezio/fhir-converter

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

39.2 kB

Total Files

37

Last publish

Collaborators

  • daniil_yakovenko
  • kluiko