@inclouded/fhir-careteam
v4.0.0
Published
``` npm install --save @inclouded/fhir-careteam ```
Downloads
8
Keywords
Readme
FHIR CareTeam Firestore SDK
npm install --save @inclouded/fhir-careteam
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the FHIR CareTeam 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
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)
The SDK can be used in a Service in the following way:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { CareTeamApi } from '@inclouded/fhir-careteam';
import { AngularFirestore } from '@angular/fire/firestore';
import { ICareTeam } from '@ahryman40k/ts-fhir-types/lib/R4';
@Injectable()
export class CareTeamService {
CareTeamApi: CareTeamApi;
constructor(private afs: AngularFirestore) {
this.CareTeamApi = new CareTeamApi(this.afs);
}
getCareTeams(): Observable<ICareTeam[]> {
return this.CareTeamApi.getAll();
}
addCareTeam(careteam: ICareTeam) {
return this.CareTeamApi.add(careteam);
}
deleteCareTeam(careteamId: string) {
return this.CareTeamApi.delete(careteamId);
}
updateCareTeam(careteam: ICareTeam) {
return this.CareTeamApi.update(careteam);
}
getCareTeamsbyName(name: string): Observable<ICareTeam[]> {
return this.CareTeamApi.getCareTeamsbyName(name);
}
getCareTeamsbyParticipant(participant: string): Observable<ICareTeam[]> {
return this.CareTeamApi.getCareTeamsbyParticipant(participant);
}
}
Usage with MongoDB
See in the description of FhirApi: a link
The CareTeam 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 CareTeam that possess more complex objects build upon these.
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])