3.0.3 • Published 2 months ago

@inclouded/fhir-device v3.0.3

Weekly downloads
35
License
-
Repository
-
Last release
2 months ago

FHIR Device Firestore SDK

npm install --save @inclouded/fhir-device

Bevezető

A repository-ban az FHIR Device erőforráshoz készült Firebase Cloud Firestore SDK található egy telepíthető Angular könyvtár formájában. Az SDK telepíthető minden Angular 2+ projekthez. Az SDK megvalósítja a szükséges CRUD műveleteket.

Használata

  1. Az SDK használatához szükséges egy Angular 2+ projekt, amelyben az angularfire2 modul segítségével van egy Firestore adatbázissal kapcsolatunk (environments.ts-ben konfigurálva).

  2. Egy Service-ben felhasználható az SDK, az alábbi módon:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { DeviceApi } from '@inclouded/fhir-device';
import { IDevice } from '@ahryman40k/ts-fhir-types/lib/R4';
import { AngularFirestore } from '@angular/fire/firestore';
import { Paging } from '@inclouded/fhirapi';

@Injectable()
export class DeviceService {

  DeviceApi: DeviceApi;
  constructor(private afs: AngularFirestore) {
    this.DeviceApi = new DeviceApi(this.afs);
  }

  addDevice(device: IDevice) {
    console.log(device);
    return this.DeviceApi.add(device);
  }

  getAllDevices(): Observable<IDevice[]> {
    return this.DeviceApi.getAll();
  }

  deleteDevice(deviceId: string) {
    return this.DeviceApi.delete(deviceId);
  }

  updateDevice(device: IDevice) {
    return this.DeviceApi.update(device);
  }

  getFreeDevices() {
    return this.DeviceApi.getFreeDevices();
  }

  getFreeDevicesbyIdentifier(identifier: string) {
    return this.DeviceApi.getFreeDevicesByIdentifier(identifier);
  }

  getDevicesWithParams(sort?: boolean, identifier?: string, type?: string, model?: string,
                       status?: string, orderBy?: string, orderDirection?: any, paging?: Paging) {
    return this.DeviceApi.getAllDevices(sort, identifier, type, model, status,
      orderBy, orderDirection, paging);
  }

  getDeviceByPatient(patient: string) {
    return this.DeviceApi.getDeviceByPatient(patient);
  }

  getDeviceByStatus(status: string) {
    return this.DeviceApi.getDeviceByStatus(status);
  }

  getDeviceByManufacturer(manufacturer: string) {
    return this.DeviceApi.getDeviceByManufacturer(manufacturer);
  }

  getDeviceByOwner(owner: string) {
    return this.DeviceApi.getDeviceByOwner(owner);
  }
}

MongoDB -vel való használata

Lásd a FhirApi leírásában: a link

A Device osztály meg kell, hogy egyezzen a az FHIR struktúrával. A komplexebb objektumok használatához rendelkezésre állnak további interfészek, erre építenek a Device komplexebb objektumokkal bíró adattagjai.

Felelős fejlesztő: Jánki Zoltán R. (jankiz@inf.u-szeged.hu), Simon Gábor (simonovszkij@gmail.com)

3.0.3

2 months ago

3.0.2

3 months ago

4.0.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago