chore(dicomweb-client): Switch to dicomweb-client.js to push logic out of OHIF
This commit is contained in:
1 parent
45c5867663
commit
89d97a7a3a
58 files changed
+256
-542
No files matched your search
@@ -55,7 +55,7 @@ const getLatestSRSeries = () => {
|
||||
if (supportedSopClassUIDs.includes(sopClassUid)) {
|
||||
if(!latestSeries) {
|
||||
latestSeries = series;
|
||||
} else if (series._data.seriesDate > latestSeries._data.seriesDate ||
|
||||
} else if (series._data.seriesDate > latestSeries._data.seriesDate ||
|
||||
(series._data.seriesDate === latestSeries._data.seriesDate && series._data.seriesTime > latestSeries._data.seriesTime)) {
|
||||
latestSeries = series;
|
||||
}
|
||||
@@ -70,36 +70,10 @@ const stringToArray = (string) => {
|
||||
return Uint8Array.from(Array.from(string).map(letter => letter.charCodeAt(0)))
|
||||
};
|
||||
|
||||
const multipartEncode = (dataset, boundary) => {
|
||||
|
||||
const denaturalizedMetaheader = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset._meta);
|
||||
const dicomDict = new dcmjs.data.DicomDict(denaturalizedMetaheader);
|
||||
|
||||
dicomDict.dict = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(dataset);
|
||||
|
||||
const part10Buffer = dicomDict.write();
|
||||
|
||||
const header = `\r\n--${boundary}\r\nContent-Type: application/dicom\r\n\r\n`;
|
||||
const footer = `\r\n--${boundary}--`;
|
||||
|
||||
headerArray = stringToArray(header);
|
||||
contentArray = new Uint8Array(part10Buffer);
|
||||
footerArray = stringToArray(footer);
|
||||
|
||||
const multipartArray = new Uint8Array(headerArray.length + contentArray.length + footerArray.length);
|
||||
|
||||
multipartArray.set(headerArray, 0);
|
||||
multipartArray.set(contentArray, headerArray.length);
|
||||
multipartArray.set(footerArray, headerArray.length + contentArray.length);
|
||||
|
||||
return(multipartArray.buffer);
|
||||
};
|
||||
|
||||
export {
|
||||
codeMeaningEquals,
|
||||
getAllDisplaySets,
|
||||
getInstanceMetadata,
|
||||
getLatestSRSeries,
|
||||
multipartEncode,
|
||||
toArray
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user