More efficient way to utilize orthancApi

Hello everyone,

Is there any documentation available for orthancApi rather than [Cheat sheet of the REST API]?

While reviewing the OE2 code, I noticed how efficiently data is managed using import api from "../orthancApi";. For example:

async reloadSeriesList() {
this.studySeries = await api.getStudySeries(this.studyId);
}

In contrast, I have been using more extensive functions to update and read metadata in OE2, such as:

async loadClinicalHistory() {
try {
const response = await this.getStudyMetadata(this.studyId, “RawClinicalHistory”);
this.rawClinicalHistory = response || “”;
this.initialClinicalHistory = this.rawClinicalHistory;
} catch (error) {
console.error(“Failed to load Clinical History:”, error);
}
}

async updateClinicalHistory() {
if (this.rawClinicalHistory !== this.initialClinicalHistory) {
try {
await this.setStudyMetadata(this.studyId, “RawClinicalHistory”, this.rawClinicalHistory);
this.initialClinicalHistory = this.rawClinicalHistory;
} catch (error) {
console.error(“Failed to update Clinical History:”, error);
}
}
}

Is there a more efficient way to handle these functions using orthancApi to manage metadata in OE2?

Thank you!

Hi,

Here is the full API doc: Orthanc REST API

And no, there’s only one way to read / update a study metadata.

Alain.