-
Notifications
You must be signed in to change notification settings - Fork 1
/
dicomQueries.js
41 lines (36 loc) · 1.38 KB
/
dicomQueries.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function queryStudy(studyUID) {
return new Promise((resolve, reject) => {
const baseUrl = document.getElementById('dicom-url').value;
const url = `${baseUrl}/studies?StudyInstanceUID=${studyUID}`;
fetch(url, {
headers: { 'Accept': 'application/json' }
})
.then(response => response.json())
.then(data => resolve(data))
.catch(error => reject(`Error querying study: ${error}`));
});
}
function querySeries(studyUID) {
return new Promise((resolve, reject) => {
const baseUrl = document.getElementById('dicom-url').value;
const url = `${baseUrl}/studies/${studyUID}/series`;
fetch(url, {
headers: { 'Accept': 'application/json' }
})
.then(response => response.json())
.then(data => resolve(data))
.catch(error => reject(`Error querying series: ${error}`));
});
}
function queryInstances(studyUID, seriesUID) {
return new Promise((resolve, reject) => {
const baseUrl = document.getElementById('dicom-url').value;
const url = `${baseUrl}/studies/${studyUID}/series/${seriesUID}/instances`;
fetch(url, {
headers: { 'Accept': 'application/json' }
})
.then(response => response.json())
.then(data => resolve(data))
.catch(error => reject(`Error querying instances: ${error}`));
});
}