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

3.1.5 • Public • Published

FHIR Patient Firestore SDK

npm install --save @inclouded/fhir-patient

Bevezető

A repository-ban az FHIR Patient 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 { PatientApi } from '@inclouded/fhir-patient';
import { IPatient } from '@ahryman40k/ts-fhir-types/lib/R4';
import { AngularFirestore } from '@angular/fire/firestore';

@Injectable()
export class PatientService {

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

  addPatient(patient: IPatient) {
    return this.PatientApi.add(patient);
  }

  getAllPatients(): Observable<IPatient[]> {
    return this.PatientApi.getAll();
  }

  getAllPatientsInAscendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getAllPatientsInAscendingOrder();
  }

  getAllPatientsInDescendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getAllPatientsInDescendingOrder();
  }

  getActivePatients(): Observable<IPatient[]> {
    return this.PatientApi.getActivePatients();
  }

  getActivePatientsInAscendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getActivePatientsInAscendingOrder();
  }

  getActivePatientsInDescendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getActivePatientsInDescendingOrder();
  }

  getInactivePatients(): Observable<IPatient[]> {
    return this.PatientApi.getInactivePatients();
  }

  getInactivePatientsInAscendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getInactivePatientsInAscendingOrder() as Observable<IPatient[]>;
  }

  getInactivePatientsInDescendingOrder(): Observable<IPatient[]> {
    return this.PatientApi.getInactivePatientsInDescendingOrder();
  }

  getGivenPatient(taj: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientByTAJ(taj);
  }

  getPatientsByPractitioner(practitionerId: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientsByPractitioner(practitionerId) as Observable<IPatient[]>;
  }

  getPatientById(patientId: string): Observable<IPatient[]> {
    return this.PatientApi.getById(patientId);
  }

  getPatientByTaj(patientTaj: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientByTAJ(patientTaj);
  }

  getPatientByName(name: string) {
    return this.PatientApi.getPatientByName(name);
  }

  getPatientByNameAndActiveInSortAscendingOrder(name: string, active: boolean) {
    return this.PatientApi.getPatientByNameAndActiveInSortAscendingOrder(name, active);
  }

  getPatientByNameAndActiveInSortDescendingOrder(name: string, active: boolean) {
    return this.PatientApi.getPatientByNameAndActiveInSortDescendingOrder(name, active);
  }

  deletePatient(patientId: string){
    return this.PatientApi.delete(patientId);
  }

  updatePatient(patient: IPatient) {
    return this.PatientApi.update(patient);
  }

  getPatientsByGender(gender: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientsByGender(gender);
  }

  getPatientsByTelecom(telecom: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientsByTelecom(telecom);
  }

  getPatientsByAddress(postalCode?: string, country?: string, city?: string, line?: string): Observable<IPatient[]> {
    return this.PatientApi.getPatientsByAddress(postalCode, country, city, line);
  }

  getPatientsByBirthDate(birthDate: Date): Observable<IPatient[]> {
    return this.PatientApi.getPatientsByBirthDate(birthDate);
  }

  getActivePatientsByTajAndNameSubStr(nameSubStr?: string, idTAJ?: string) {
    return this.PatientApi.getActivePatientsByTajAndNameSubStr(nameSubStr, idTAJ);
  }

  getPatientsByGroupExtension(groupExtension: string) {
    return this.PatientApi.getPatientsByGroupExtension(groupExtension);
  }
}

MongoDB -vel való használata

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

A Patient 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 Patient komplexebb objektumokkal bíró adattagjai.

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

Readme

Keywords

none

Package Sidebar

Install

npm i @inclouded/fhir-patient

Weekly Downloads

7

Version

3.1.5

License

none

Unpacked Size

554 kB

Total Files

33

Last publish

Collaborators

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