Mercurial > hg > orthanc-java
comparison JavaSDK/be/uclouvain/orthanc/WorklistQuery.java @ 0:3ecef5782f2c
initial commit
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Oct 2023 17:59:44 +0200 |
parents | |
children | 26c08ff926a3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3ecef5782f2c |
---|---|
1 package be.uclouvain.orthanc; | |
2 | |
3 /** | |
4 * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium | |
5 * SPDX-License-Identifier: GPL-3.0-or-later | |
6 */ | |
7 | |
8 /** | |
9 * Java plugin for Orthanc | |
10 * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium | |
11 * | |
12 * This program is free software: you can redistribute it and/or | |
13 * modify it under the terms of the GNU General Public License as | |
14 * published by the Free Software Foundation, either version 3 of the | |
15 * License, or (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, but | |
18 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
20 * General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program. If not, see http://www.gnu.org/licenses/. | |
24 **/ | |
25 | |
26 | |
27 /** | |
28 * DICOM C-FIND worklist query | |
29 **/ | |
30 public class WorklistQuery { | |
31 private long self; | |
32 | |
33 /** | |
34 * Construct a Java object wrapping a C object that is managed by Orthanc. | |
35 * @param self Pointer to the C object. | |
36 **/ | |
37 protected WorklistQuery(long self) { | |
38 if (self == 0) { | |
39 throw new IllegalArgumentException("Null pointer"); | |
40 } else { | |
41 this.self = self; | |
42 } | |
43 } | |
44 | |
45 /** | |
46 * Return the C object that is associated with this Java wrapper. | |
47 * @return Pointer to the C object. | |
48 **/ | |
49 protected long getSelf() { | |
50 return self; | |
51 } | |
52 | |
53 | |
54 | |
55 /** | |
56 * Test whether a worklist matches the query. | |
57 * | |
58 * This function checks whether one worklist (encoded as a DICOM file) matches the | |
59 * C-Find SCP query against modality worklists. This function must be called before | |
60 * adding the worklist as an answer through OrthancPluginWorklistAddAnswer(). | |
61 * | |
62 * @param dicom The worklist to answer, encoded as a DICOM file. | |
63 * @return 1 if the worklist matches the query, 0 otherwise. | |
64 **/ | |
65 public int worklistIsMatch( | |
66 byte[] dicom) { | |
67 return NativeSDK.OrthancPluginWorklistIsMatch(self, dicom); | |
68 } | |
69 | |
70 /** | |
71 * Retrieve the worklist query as a DICOM file. | |
72 * | |
73 * This function retrieves the DICOM file that underlies a C-Find SCP query against | |
74 * modality worklists. | |
75 * | |
76 * @return The resulting memory buffer. | |
77 **/ | |
78 public byte[] worklistGetDicomQuery() { | |
79 return NativeSDK.OrthancPluginWorklistGetDicomQuery(self); | |
80 } | |
81 | |
82 } |