@inclouded/fhir-organization
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

FHIR Organization Firestore SDK

npm install --save @inclouded/fhir-organization

Introduction

In the repository the Firebase Cloud Firestore SDK can be found that was made for the FHIR Organization 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:

import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { OrganizationApi } from '@inclouded/fhir-organization';
import { AngularFirestore } from '@angular/fire/firestore';
import { IOrganization } from '@ahryman40k/ts-fhir-types/lib/R4';

@Injectable()
export class OrganizationService {

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

  getOrganizations(): Observable<IOrganization[]> {
    return this.OrganizationApi.getAll();
  }

  addOrganization(organization: IOrganization) {
    return this.OrganizationApi.add(organization);
  }

  deleteOrganization(organizationId: string) {
    return this.OrganizationApi.delete(organizationId);
  }

  updateOrganization(organization: IOrganization) {
    return this.OrganizationApi.update(organization);
  }

  getOrganizationstsbyIdentifier(identifier: string): Observable<IOrganization[]> {
    return this.OrganizationApi.getOrganizationsbyIdentifier(identifier);
  }

  getOrganizationById(id: string) {
    return this.OrganizationApi.getById(id);
  }

  getOrganizationsbyName(name: string): Observable<IOrganization[]> {
    return this.OrganizationApi.getOrganizationsbyName(name);
  }

  getOrganizationsbyAddress(addressPostalCode?: string, addressCountry?: string, addressCity?: string,
    addressLine?: string): Observable<IOrganization[]> {
    return this.OrganizationApi.getOrganizationsbyAddress(addressPostalCode, addressCountry, addressCity, addressLine);
  }

  getOrganizationsByStatus(status: boolean): Observable<IOrganization[]> {
    return this.OrganizationApi.getOrganizationsByStatus(status);
  }

  getPractitionerByNameSubStr(nameSubStr: string) {
    return this.OrganizationApi.getPractitionerByNameSubStr(nameSubStr);
  }
}

Usage with MongoDB

See in the description of FhirApi: a link

The Organization 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 Organization that possess more complex objects build upon these.

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

Readme

Keywords

none

Package Sidebar

Install

npm i @inclouded/fhir-organization

Weekly Downloads

14

Version

4.0.3

License

none

Unpacked Size

259 kB

Total Files

32

Last publish

Collaborators

  • zbiacsi
  • bilickiv
  • m2m-deploy
  • jankiz
  • grindy