UNPKG

gcp-nrces-fhir

Version:

Google cloud healthcare api NRCES FHIR implimenataion

99 lines 4.32 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ImmunizationRecommendation = void 0; const ResourceMai_1 = __importDefault(require("./ResourceMai")); class ImmunizationRecommendation extends ResourceMai_1.default { toHtml() { return __awaiter(this, void 0, void 0, function* () { throw new Error("Method not implemented."); }); } getFHIR(options) { const supportingImmunization = () => { let ret = options.recommendation.map((el) => { if (el.supportingImmunization && el.supportingImmunization.length > 0) { return Object.assign(Object.assign({}, el), { supportingImmunization: el.supportingImmunization.map((pl) => { return Object.assign(Object.assign({}, pl), { reference: `Immunization/${pl.reference}` }); }) }); } else { return el; } }); return ret; }; const body = Object.assign(Object.assign({}, options), { patient: { reference: `Patient/${options.patient.reference}` }, authority: { reference: `Organization/${options.authority.reference}` }, recommendation: supportingImmunization() }); return body; } convertFhirToObject(options) { throw new Error("Method not implemented."); } } exports.ImmunizationRecommendation = ImmunizationRecommendation; const body = { resourceType: "ImmunizationRecommendation", id: "example-01", text: { status: "generated", div: '<div xmlns="http://www.w3.org/1999/xhtml">This is Immunization Recommendation for hepatitis A vaccine to be taken on 2021-05-10.</div>', }, patient: { reference: "Patient/1" }, date: "2021-01-10T11:04:15.817-05:00", authority: { reference: "Organization/1" }, recommendation: [ { vaccineCode: [ { coding: [ { system: "http://snomed.info/sct", code: "871751006", display: "Hepatitis A vaccine", }, ], }, ], forecastStatus: { coding: [ { system: "http://terminology.hl7.org/CodeSystem/immunization-recommendation-status", code: "due", display: "Due", }, ], }, dateCriterion: [ { code: { coding: [ { system: "http://loinc.org", code: "30980-7", display: "Date vaccine due", }, ], }, value: "2021-05-10T00:00:00-05:00", }, ], description: "First sequence in protocol", series: "Vaccination Series 1", doseNumberPositiveInt: 1, seriesDosesPositiveInt: 3, supportingImmunization: [{ reference: "Immunization/1" }], }, ], }; //# sourceMappingURL=ImmunizationRecommendation.js.map