File: SRCode.java

package info (click to toggle)
dicomscope 3.6.0-28
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,256 kB
  • sloc: java: 22,911; cpp: 5,957; sh: 270; makefile: 45
file content (245 lines) | stat: -rw-r--r-- 7,516 bytes parent folder | download | duplicates (9)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/*
 *
 *  Copyright (C) 1999, Institute for MicroTherapy
 *
 *  This software and supporting documentation were developed by
 *
 *    University of Witten/Herdecke
 *    Department of Radiology and MicroTherapy
 *    Institute for MicroTherapy
 *    Medical computer science
 *    
 *    Universitaetsstrasse 142
 *    44799 Bochum, Germany
 *    
 *    http://www.microtherapy.de/go/cs
 *    mailto:computer.science@microtherapy.de
 *
 *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND THE INSTITUTE MAKES  NO 
 *  WARRANTY REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY
 *  OR FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES 
 *  OR ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY 
 *  AND PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
 *
 *  Author :      $Author: kleber $
 *  Last update : $Date: 2001/06/06 10:32:30 $
 *  Revision :    $Revision: 1.1.1.1 $
 *  State:        $State: Exp $
*/
package main;
import J2Ci.*;

/**
* This class contains all attributes of codes structured report code.
* Furthermore an attriute is inseted calling Context Group.
* A Context Group groups the codes so that they can be used 
* in a special context. For example there can be a Context Group
* for all measurements.
*
* @author Klaus Kleber
*/
public class SRCode 
{
    public static final String CONTEXT_GROUP_NAME_DOCUMENT_TITLE = "Document Title";       
    public static final String CONTEXT_GROUP_NAME_SECTION_HEADING = "Section Heading";       
    public static final String CONTEXT_GROUP_NAME_REPORT_ELEMENT = "Report Element";       
    public static final String CONTEXT_GROUP_NAME_IMAGE_REFERENCE = "Image Reference";       
    public static final String CONTEXT_GROUP_NAME_TEMPORALCOORD = "Temporal coordinate";       
    public static final String CONTEXT_GROUP_NAME_SPATIALCOORD = "Spatial coordinate";       
    public static final String CONTEXT_GROUP_NAME_DATE = "Date";       
    public static final String CONTEXT_GROUP_NAME_TIME = "Time";       
    public static final String CONTEXT_GROUP_NAME_DATETIME = "Date/Time";       
    public static final String CONTEXT_GROUP_NAME_ORGANIZATIONAL_ROLE = "Organizational Role";       
    public static final String CONTEXT_GROUP_NAME_NUMERIC_MEASUREMENTS = "Numeric Measurement";       
    public static final String CONTEXT_GROUP_NAME_MEASUREMENT_UNIT = "Measurement Unit";       
    public static final String CONTEXT_GROUP_NAME_UID_REFERENCE = "UID Reference";       
    public static final String CONTEXT_GROUP_NAME_CODE = "Code";       
    public static final String CONTEXT_GROUP_NAME_WAVEFORM = "Waveform";       
    public static final String CONTEXT_GROUP_NAME_COMPOSITE = "Composite";       
    /**
    * Contains the Context Group
    */
    private  String contextGroup;
    
    /**
    * Contains the Coding Scheme Designator
    */
    private String codingSchemeDesignator;
    
    /**
    * Contains the Coding Scheme Version
    */
    private String codingSchemeVersion;
    
    /**
    * Contains the Code Value
    */
    private String codeValue;
    
    /**
    * Contains the Code Meaning
    */
    private String codeMeaning;
    
    
    /**
    * Contains the  name of the Context Group
    */
    private String identifier;
    
    
    /**
    * If the code is not a default code.
    * A code is not a default code if the user 
    * inserted the code manually or if a SR report
    * contains a code which is unknown.
    */
    private boolean isDefault = true;
    
    public SRCode()
    {}
    public SRCode( String contextGroup,
                    String codingSchemeDesignator,
                    String codingSchemeVersion,
                    String codeValue,
                    String codeMeaning)
    {
        this.codeMeaning = codeMeaning;
        this.codeValue = codeValue;
        if(codeValue==null) codeValue="";
        this.codingSchemeDesignator = codingSchemeDesignator;
        if(codingSchemeDesignator==null) codingSchemeDesignator="";
        this.codingSchemeVersion = codingSchemeVersion;
        if(codingSchemeVersion==null) codingSchemeVersion="";
        this.contextGroup = contextGroup;
        
        
    }
    public String toValueString()
    {
        return new String("Context Group: " + contextGroup+ 
                         "\nCoding Scheme Designator: " + codingSchemeDesignator+
                         "\nCoding Scheme Version: " + codingSchemeVersion+
                         "\nCode Value: " + codeValue+
                         "\nCode Meaning: " + codeMeaning);
    }
    
    /**
    * Sets the isDefault value. 
    * A code is not a default code if the user 
    * inserted the code manually or if a SR report
    * contains a code which is unknown.
    */  
    public void  setDefault(boolean isDefault)
    {
        this.isDefault = isDefault;
    }
    public String getIdentifier()
    {
        return codeValue+"/" + codingSchemeDesignator+"/"+codingSchemeVersion;
    }
    public String toString()
    {
        if (!isDefault) return "* " + codeMeaning;
        else return codeMeaning;
    }
         
    
    /**
    * Returns the Code Value
    * @return The Code Value
    */
    public String getCodeValue()
    {
        return codeValue;
    }
    /**
    * Returns the Code Meaning
    * @return The Code Meaning
    */
    public String getCodeMeaning()
    {
        return codeMeaning;
    }
    
    /**
    * Returns the Context Group
    * @return The Context Group
    */
    public String getContextGroup()
    {
        return contextGroup;
    }
    /**
    * Returns the Coding Scheme Designator
    * @return The Coding Scheme Designator
    */
    public String getCodingSchemeDesignator()
    {
        return codingSchemeDesignator;
    }
    /**
    * Returns the Coding Scheme Version
    * @return The Coding Scheme Version
    */
    public String getCodingSchemeVersion()
    {
        return codingSchemeVersion;
    }
    /**
    * Sets the Coding Scheme Designator
    * @param codingSchemeDesignator Coding Scheme Designator
    */
    public void setCodingSchemeDesignator(String codingSchemeDesignator)
    {
        this.codingSchemeDesignator= codingSchemeDesignator;
        if (this.codingSchemeDesignator == null) codingSchemeDesignator = "";
    }
    /**
    * Sets the Coding Scheme Version
    * @param codingSchemeVersion Coding Scheme Version
    */
    public void setCodingSchemeVersion(String codingSchemeVersion)
    {
        this.codingSchemeVersion= codingSchemeVersion;
        if (this.codingSchemeVersion == null) codingSchemeVersion = "";
    }
    /**
    * Sets the Context Group
    * @param contextGroup Context Group
    */
    public void setContextGroup(String contextGroup)
    {
        this.contextGroup= contextGroup;
        if (this.contextGroup == null) contextGroup = "";
    }
    
    /**
    * Sets the Code Value
    * @param codeValue Code Value
    */
    public void setCodeValue(String codeValue)
    {
        this.codeValue= codeValue;
        if (this.codeValue == null) codeValue = "";
    }
    
    /**
    * Sets the Code Meaning
    * @param codeMeaning Code Meaning
    */
    public void setCodeMeaning(String codeMeaning)
    {
        this.codeMeaning= codeMeaning;
        if (this.codeMeaning == null) codeMeaning = "";
    }
    
}
/*
 *  CVS Log
 *  $Log: SRCode.java,v $
 *  Revision 1.1.1.1  2001/06/06 10:32:30  kleber
 *  Init commit for DICOMscope 3.5
 *  Create new CVS
 *
*/