gcp-nrces-fhir
Version:
Google cloud healthcare api NRCES FHIR implimenataion
84 lines • 3.07 kB
JavaScript
;
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.Slot = void 0;
const ResourceMai_1 = __importDefault(require("./ResourceMai"));
const statusArray = [
"busy",
"free",
"busy-unavailable",
"busy-tentative",
"entered-in-error",
];
class Slot extends ResourceMai_1.default {
toHtml() {
return __awaiter(this, void 0, void 0, function* () {
throw new Error("Method not implemented.");
});
}
getFHIR(options) {
const getText = () => {
let ret = "";
ret = options.comment;
return ret;
};
const body = {
resourceType: "Slot",
id: options.id,
text: {
status: "generated",
div: getText(),
},
serviceCategory: options.serviceCategory,
serviceType: options.serviceType,
specialty: options.specialty,
appointmentType: options.appointmentType,
schedule: {
reference: `Schedule/${options.scheduleId}`,
},
status: options.status,
start: options.start,
end: options.end,
comment: options.comment,
};
return body;
}
convertFhirToObject(options) {
const ret = {
id: options.id,
comment: options.comment,
appointmentType: options.appointmentType,
scheduleId: this.getIdFromReference({ "ref": options.schedule.reference, "resourceType": "Schedule" }),
status: options.status,
start: options.start,
end: options.end
};
if (options.serviceCategory) {
ret.serviceCategory = options.serviceCategory;
}
if (options.serviceType) {
ret.serviceType = options.serviceType;
}
if (options.specialty) {
ret.specialty = options.specialty;
}
return ret;
}
statusArray() {
const ret = statusArray.map((el) => el);
return ret;
}
}
exports.Slot = Slot;
//# sourceMappingURL=Slot.js.map