@inclouded/fhir-diagnosticreport
v2.0.0
Published
``` npm install --save @inclouded/fhir-diagnosticreport ```
Downloads
12
Keywords
Readme
FHIR DiagnosticReport Firestore SDK
npm install --save @inclouded/fhir-diagnosticreport
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the FHIR DiagnosticReport 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 { DiagnosticReportApi } from '@inclouded/fhir-diagnosticreport';
import { AngularFirestore } from '@angular/fire/firestore';
import { IDiagnosticReport } from '@ahryman40k/ts-fhir-types/lib/R4';
@Injectable()
export class DiagnosticReportService {
DiagnosticReportApi: DiagnosticReportApi;
constructor(private afs: AngularFirestore) {
this.DiagnosticReportApi = new DiagnosticReportApi(this.afs);
}
getDiagnosticReports(): Observable<IDiagnosticReport[]> {
return this.DiagnosticReportApi.getAll();
}
getDiagnosticReportById(id: string): Observable<IDiagnosticReport[]> {
return this.DiagnosticReportApi.getById(id);
}
addDiagnosticReport(diagnosticReport: IDiagnosticReport) {
return this.DiagnosticReportApi.add(diagnosticReport);
}
deleteDiagnosticReport(diagnosticReportId: string) {
return this.DiagnosticReportApi.delete(diagnosticReportId);
}
updateDiagnosticReport(diagnosticReport: IDiagnosticReport) {
return this.DiagnosticReportApi.update(diagnosticReport);
}
getDiagnosticReportsBySubject(subject: string) {
return this.DiagnosticReportApi.getAllDiagnosticReportsBySubject(subject);
}
getDiagnosticReportsByBasedOn(basedOn: string) {
return this.DiagnosticReportApi.getAllDiagnosticReportsByBasedOn(basedOn);
}
getDiagnosticReportsByStatus(status: string) {
return this.DiagnosticReportApi.getAllDiagnosticReportsByStatus(status);
}
getAllDiagnosticReportsByCode(code: string) {
return this.DiagnosticReportApi.getAllDiagnosticReportsByCode(code);
}
getAllDiagnosticReportsByPerformer(performer: string) {
return this.DiagnosticReportApi.getAllDiagnosticReportsByPerformer(performer);
}
}
Usage with MongoDB
See in the description of FhirApi: a link
The DiagnosticReport 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 DiagnosticReport that possess more complex objects build upon these.
Developer: Zoltán R. Jánki ([email protected]), Gábor Simon ([email protected])