npm package: @inclouded/fhir-observation
Description: ``` npm install --save @inclouded/fhir-observation ```
Latest version: 4.0.2

# FHIR Observation Firestore SDK

```
npm install --save @inclouded/fhir-observation
```

## Introduction

In the repository the Firebase Cloud Firestore SDK can be found that was made for the FHIR Observation resource in an installable Angular folder form. The SDK can be installed for every Angular 2+ project. The SDK accomplishes the necessary CRUD operations.

## Usage

1. For using the SDK an Angular 2+ project is needed, in which we can establish a connection to a Firestore database instance. (configured in environments.ts)

2. The SDK can be used in a Service in the following way:

```typescript
import { Injectable } from '@angular/core';
import {
    ActivityObservationApi,
    BloodGlucoseObservationApi,
    BloodPressureObservationApi,
    BloodTypeObservationApi,
    BodyHeightObservationApi,
    BodyWeightObservationApi,
    DialysisObservationApi,
    EcgObservationApi,
    EpilepsyObservationApi,
    EthnicityObservationApi,
    ExaminationObservationApi,
    HeartRateObservationApi,
    LaboratoryTestObservationApi,
    LifeStyleObservationApi,
    NutrientObservationApi,
    ObservationApi,
    SpiroObservationApi
} from '@inclouded/fhir-observation';
import { Observable } from 'rxjs';
import { AngularFirestore } from '@angular/fire/firestore';
import { IObservation } from '@ahryman40k/ts-fhir-types/lib/R4';

@Injectable()
export class ObservationsService {

    ActivityObservationApi: ActivityObservationApi;
    BloodGlucoseObservationApi: BloodGlucoseObservationApi;
    BloodPressureObservationApi: BloodPressureObservationApi;
    BloodTypeObservationApi: BloodTypeObservationApi;
    BodyHeightObservationApi: BodyHeightObservationApi;
    BodyWeightObservationApi: BodyWeightObservationApi;
    DialysisObservationApi: DialysisObservationApi;
    EcgObservationApi: EcgObservationApi;
    EpilepsyObservationApi: EpilepsyObservationApi;
    EthnicityObservationApi: EthnicityObservationApi;
    ExaminationObservationApi: ExaminationObservationApi;
    HeartRateObservationApi: HeartRateObservationApi;
    LaboratoryTestObservationApi: LaboratoryTestObservationApi;
    LifeStyleObservationApi: LifeStyleObservationApi;
    NutrientObservationApi: NutrientObservationApi;
    ObservationApi: ObservationApi;
    SpiroObservationApi: SpiroObservationApi;

    constructor(private afs: AngularFirestore) {
        this.ActivityObservationApi = new ActivityObservationApi(this.afs);
        this.BloodGlucoseObservationApi = new BloodGlucoseObservationApi(this.afs);
        this.BloodPressureObservationApi = new BloodPressureObservationApi(this.afs);
        this.BloodTypeObservationApi = new BloodTypeObservationApi(this.afs);
        this.BodyHeightObservationApi = new BodyHeightObservationApi(this.afs);
        this.BodyWeightObservationApi = new BodyWeightObservationApi(this.afs);
        this.DialysisObservationApi = new DialysisObservationApi(this.afs);
        this.EcgObservationApi = new EcgObservationApi(this.afs);
        this.EpilepsyObservationApi = new EpilepsyObservationApi(this.afs);
        this.EthnicityObservationApi = new EthnicityObservationApi(this.afs);
        this.ExaminationObservationApi = new ExaminationObservationApi(this.afs);
        this.HeartRateObservationApi = new HeartRateObservationApi(this.afs);
        this.LaboratoryTestObservationApi = new LaboratoryTestObservationApi(this.afs);
        this.LifeStyleObservationApi = new LifeStyleObservationApi(this.afs);
        this.NutrientObservationApi = new NutrientObservationApi(this.afs);
        this.ObservationApi = new ObservationApi(this.afs);
        this.SpiroObservationApi = new SpiroObservationApi(this.afs);
    }

}

```

## Usage with MongoDB

See in the description of FhirApi:
[a link](https://www.npmjs.com/package/@inclouded/fhirapi)

> The Observation class must be equal with the form.value, this way there's no need for building the object locally. For the usage of the more complex objects there are more available interfaces, the properties of Observation that possess more complex objects build upon these. 

Developer: Bence Lakos (bencelakos@gmail.com), Zoltán R. Jánki (jankiz@inf.u-szeged.hu), Gábor Simon (simonovszkij@gmail.com)