gcp-nrces-fhir
Version:
Google cloud healthcare api NRCES FHIR implimenataion
259 lines • 13.8 kB
TypeScript
/// <reference types="node" />
import { ResourceMaster } from "../../Interfaces";
import { ENCOUNTER } from "../Encounter";
import { PATIENT } from "../Patient";
import { ORGANIZATION } from "../Organization";
import ResourceMain from "../ResourceMai";
import { DIAGNOSTIC_REPORT, SPECIMEN } from "../..";
import { PDF_HEADER } from "js-ts-report";
import { EXTENSION, resourceType } from "../../config";
import { PDF_FOOter } from "js-ts-report/build/classes/create-pdf";
import { Readable } from "stream";
interface PDF_DATA {
html: string;
header?: (options: PDF_HEADER) => [];
footer?: (options: PDF_FOOter) => [];
composition: COMPOSITOIN;
base64: boolean;
signBase64: string;
nameLine1: string;
nameLine2?: string;
qrCode: string;
qrCodeWidth?: number;
paperSize: string;
headerbase64Image?: string;
paragraphSpace?: number;
singleImagePerPage?: boolean;
/**
* This is letter pad header preprinted
*/
topMargin?: number;
bottomMargin?: number;
}
export declare const compositionTypeArrey: readonly [{
readonly type: "OPConsultation";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/OPConsultRecord";
readonly code: "371530004";
readonly text: "Clinical consultation report";
}, {
readonly type: "DischargeSummary";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/DischargeSummaryRecord";
readonly code: "373942005";
readonly text: "Discharge summary";
}, {
readonly type: "ImmunizationRecord";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/ImmunizationRecord";
readonly code: "41000179103";
readonly text: "Immunization record";
}, {
readonly type: "Prescription";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/PrescriptionRecord";
readonly code: "440545006";
readonly text: "Prescription record";
}, {
readonly type: "HealthDocumentRecord";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/HealthDocumentRecord";
readonly code: "419891008";
readonly text: "Health Document";
}, {
readonly type: "DiagnosticReport";
readonly system: "https://ndhm.gov.in/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/DiagnosticReportRecord";
readonly code: "721981007";
readonly text: "Diagnostic studies report";
}, {
readonly type: "InitialAssessment";
readonly system: "http://snomed.info/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/InitialAssessment";
readonly code: "371530004";
readonly text: "Initial assessment report";
}, {
readonly type: "DietaryRecord";
readonly system: "http://snomed.info/sct";
readonly url: "https://nrces.in/ndhm/fhir/r4/StructureDefinition/DietaryRecord";
readonly code: "440654000";
readonly text: "Dietary record";
}];
declare const onlyType: ("DiagnosticReport" | "OPConsultation" | "DischargeSummary" | "ImmunizationRecord" | "Prescription" | "HealthDocumentRecord" | "InitialAssessment" | "DietaryRecord")[];
export declare type compositionType = typeof onlyType[number];
declare const compositionStatusArrey: readonly ["preliminary", "final", "amended", "entered-in-error"];
export declare type compositionStatus = typeof compositionStatusArrey[number];
export interface compositionAuthor {
reference: string;
display: string;
}
export interface COMPOSITOIN {
id?: string;
identifier?: string;
/**
* user Object
*/
user?: USER_COMPOSITION_EXTENSION[];
patient: PATIENT;
patientId: string;
encounter: ENCOUNTER;
encounterId: string;
date: string;
author: compositionAuthor[];
organization: ORGANIZATION;
organizationId: string;
status: compositionStatus;
type: compositionType;
documentDatahtml?: string;
section: any[];
extension?: EXTENSION[];
documentSubType?: string;
}
export interface USER_COMPOSITION_EXTENSION {
date: string;
id: number;
orgId: number;
name: string;
orgName: string;
}
export declare class Composition extends ResourceMain implements ResourceMaster {
toHtml(composition: COMPOSITOIN): Promise<string>;
private compType;
mapCompositionType(type: compositionType): void;
private _patient;
get patient(): PATIENT;
private _organization;
get organization(): ORGANIZATION;
/**
* This are persons who interpt the result in care of diagnostic report and in care of the others these who treat patinets
*/
private _practitioner;
get practitioner(): any;
private _encounter;
get encounter(): ENCOUNTER;
/**
* This is for diagnostic reporting enity requesting the services
*/
private requeter;
/** This form specimen */
private specimenCollectedTime;
/** This form specimen */
private specimenRecivedTime;
/**Sample Type */
private specimenType;
private reportedDateandTime;
private performer;
setEncounter(id: string): Promise<void>;
setPatient(id: string): Promise<void>;
setOrganization(id: string): Promise<void>;
setPractitioner(id: string): Promise<void>;
getOpdOrIPDNumber(encounter: ENCOUNTER): {
type: "IPD" | "OPD";
"opdOrIpdNumber": string;
"value": string;
};
/**
* service requested by could be patient , organization, patient him or herself
* this is applicable diagnostic report
*/
setRequester: (options: {
reesource: resourceType;
display: string;
}) => void;
setSpecimenRecivedAndCollectedTime: (specimen: SPECIMEN) => void;
setDiagnosticReportDateTime: (diagnosticReport: DIAGNOSTIC_REPORT) => void;
setPerformer: (options: {
reesource: resourceType;
display: string;
}) => void;
getFHIR(options: COMPOSITOIN): {
resourceType: string;
id: string | undefined;
meta: {
versionId: string;
lastUpdated: string;
profile: string[];
};
language: string;
text: {
status: string;
div: string;
};
extension: any[];
identifier: {
system: string;
value: string;
};
status: "entered-in-error" | "preliminary" | "final" | "amended";
type: {
coding: {
system: string;
code: string;
display: string;
}[];
text: string;
};
subject: {
reference: string;
};
encounter: {
reference: string;
};
date: string;
author: compositionAuthor[];
title: "DiagnosticReport" | "OPConsultation" | "DischargeSummary" | "ImmunizationRecord" | "Prescription" | "HealthDocumentRecord" | "InitialAssessment" | "DietaryRecord";
custodian: {
reference: string;
};
section: {
title: string;
code: {
coding: {
system: string;
code: string;
display: "DiagnosticReport" | "OPConsultation" | "DischargeSummary" | "ImmunizationRecord" | "Prescription" | "HealthDocumentRecord" | "InitialAssessment" | "DietaryRecord";
}[];
};
entry: any[];
}[];
};
convertFhirToObject(options: any): Partial<COMPOSITOIN>;
statusArray(): compositionStatus[];
typeArray(): compositionType[];
/**
* this function return the all resources of copistion namely Patient, Author/Practioner, Encounter and entries in section
* @param id composition id
* @returns
*/
getWithIncludes: (id: string) => Promise<any>;
/**
* This function returns all the compositions of patient
* @param id of patient
* @returns
*/
getCompositionsByPatient: (id: string) => Promise<any>;
/**
*
* @param id This array of ids many merged pateints
* @returns compostions
*/
getCompositionsByPatientArray: (id: string[]) => Promise<any>;
pdfPreprocess: (options: PDF_DATA) => Promise<any>;
getPdf: (options: PDF_DATA) => Promise<string | Buffer>;
getPdfStream: (options: PDF_DATA) => Promise<Readable>;
getMediaComposition: (index: number, mediaId: string[], content: string[]) => Promise<void>;
/**
* This returns the diagnosis from encounter
* @param encounter
* @returns
*/
getDiagnosisFromEnconter(diagnosis: ENCOUNTER["diagnosis"], index: number, diagnosisStringArray: string[]): Promise<void>;
}
export declare const emptySign = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAACZCAMAAAB+KoMCAAAAMFBMVEX////n5ubm5eXl5OTz8/P6+vrw7+/s6+v39vb//Pnu7e3q6en5+fn//fvz8e/39PJx9eXWAAAMj0lEQVR4nO1diZazrBJUNCYu6Pu/7dDdbCIKGjNigv+55+s7qcxAidhbaVHA0bCyLJ9o9sJiNZoVmANYL/i8ioIOBlqD2aP5hM8bA32B9XCgJZod01BmoPCt6uGDdmiWeiwWFIfN9LAldO8MGwc6OFA1wyJT+eVUdpnK86jkd6WyYqyib5dMmPIPgUnfRtNA6dt9tQ2tDfQJZmOgkp8ZlJUG2nG+CSV+OoSiyZxhE5XOsP0z3ID2zrA3ySgaOOoXHGiiVXvNELSJh9bO5zPoNE1j1zVNNwUGUMeP9ehYdsyQTufGIukAYJ15C2pOJ3OhwTMP0LVF0vJ2klBOZ15CexZeJExeBiz+MoCxxEFdMuoZGeWbN9RXYOsqHKjZZNjajss5nxAqDH546/Jszv59/DSXIT0quUWlWKDEDxcE34HKSn/brOmSLX0TZkGZ4ge+xRZ/SHy/WlBp/oBNJZuzPvC2bYnKtuVEpYAKq+3ZjB91gc9PkLrA51CLH0mlnqENdWYoySg9ZJgZaiqfcLwe4nihOYBZg9WB9WjAbNDEz2uwBgf6dKGdA3050HoDOgzivgNWP4E14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60G/Me8Fr8hIV5nWJCPMK94158npjCOXar5SLJAvzjgWOL3xdMJq5TPYular4eJOKY0KZoWXfCbwuWOcvszAvut3R91sn/Ua9/xLmHSAj6Sy6debBF8rCvLNc9OSbAm9DJb8Tlcfr4Deh8jeEeQ50kTnDHpeUhHneGR6ZmRnuJ3qGFueOtw709HP3bcI84sd3vd3JRc9U/giV/EZUrqcP/1OYtw5tD3jMtxfmnf6WOjTHaTohqP01Yd5K4AipjCzMO8FFf3INvUW0kzCV/R2ovPwCt4V5+qp1oZJK51L8BmGeCz3pjXkbdblh2Ib+uzBvOZaCTmcKzlCgljqDZmGehu7dnIf7uOiZyp+h8vFBKr9amLeZIE0pyXZcmFeuyNbKbbXdDmHeSm+sdNE31HYWtAhAD81wAXWHnaowb9F3YnXWZGFeLJWn3QVy4HhjKoOBYxotBUTlZzJDZ7UUXC1n+56jMKczlfarQ4skC/MObM7Juuh/8LcZggUqlBMAAAAASUVORK5CYII=";
export interface Records {
create: Function;
update: Function;
getOptions: Function;
}
export {};
//# sourceMappingURL=index.d.ts.map