gcp-nrces-fhir
Version:
Google cloud healthcare api NRCES FHIR implimenataion
87 lines • 3.34 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Coverage = void 0;
const ResourceMai_1 = __importDefault(require("./ResourceMai"));
const CoverageStatus = [
"active",
"cancelled",
"draft",
"entered-in-error",
];
const CoverageKind = ["insurance", "self-pay", "other"];
class Coverage extends ResourceMai_1.default {
getFHIR(options) {
var _a, _b;
const getText = () => {
let ret = "";
ret = options.text;
return ret;
};
const body = {
id: options.id,
identifier: options.identifier,
meta: {
lastUpdated: new Date().toISOString(),
profile: [
"https://nrces.in/ndhm/fhir/r4/StructureDefinition/Coverage",
],
},
text: {
status: "generated",
div: getText(),
},
status: options.status,
kind: options.kind,
paymentBy: (_a = options.paymentBy) === null || _a === void 0 ? void 0 : _a.map((el) => {
return {
party: { reference: `${el.party.resource}/${el.party.id}` },
responsibility: el.responsibility,
};
}),
policyHolder: options.policyHolder
? {
reference: `${options.policyHolder.resource}/${options.policyHolder.id}`,
}
: undefined,
subscriber: options.subscriber
? {
reference: `${options.subscriber.resource}/${options.subscriber.id}`,
}
: undefined,
beneficiary: { reference: `Patient/${options.beneficiaryPatientId}` },
dependent: options.dependent,
relationship: options.relationship,
payer: options.payer.map((el) => {
const ret = { reference: `${el.resource}/${el.id}` };
if (el.display) {
ret.display = el.display;
}
return ret;
}),
period: options.period,
insurer: options.insurerOrganizationId
? { reference: `Organization/${options.insurerOrganizationId}` }
: undefined,
class: options.class,
order: options.order,
network: options.network,
costToBeneficiary: options.costToBeneficiary,
subrogation: options.subrogation,
contract: (_b = options.contractId) === null || _b === void 0 ? void 0 : _b.map((el) => {
return { reference: `Contract/${options.contractId}` };
}),
insurancePlan: options.insurancePlanId
? { reference: `InsurancePlan/${options.insurancePlanId}` }
: undefined,
};
return body;
}
convertFhirToObject(options) {
throw new Error("Method not implemented.");
}
}
exports.Coverage = Coverage;
//# sourceMappingURL=Coverage%20copy.js.map