• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 15205088843

23 May 2025 07:43AM UTC coverage: 65.083% (+0.01%) from 65.069%
15205088843

push

github

rkorytkowski
TRUNK-6300: Adding Windows test, cleaning up logs, adjusting variable name

2 of 2 new or added lines in 2 files covered. (100.0%)

336 existing lines in 18 files now uncovered.

23379 of 35922 relevant lines covered (65.08%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.08
/api/src/main/java/org/openmrs/ConceptDatatype.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs;
11

12
import javax.persistence.Cacheable;
13

14
import org.hibernate.annotations.Cache;
15
import org.hibernate.annotations.CacheConcurrencyStrategy;
16
import org.hibernate.envers.Audited;
17

18
/**
19
 * ConceptDatatype
20
 */
21
@Audited
22
@Cacheable
23
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
24
public class ConceptDatatype extends BaseChangeableOpenmrsMetadata {
25
        
26
        public static final long serialVersionUID = 473L;
27
        
28
        // HL7 abbreviations (along with our own boolean creature)
29
        
30
        public static final String BOOLEAN = "BIT";
31
        
32
        public static final String CODED = "CWE";
33
        
34
        public static final String DATE = "DT";
35
        
36
        public static final String DATETIME = "TS";
37
        
38
        public static final String DOCUMENT = "RP";
39
        
40
        public static final String NUMERIC = "NM";
41
        
42
        public static final String TEXT = "ST";
43
        
44
        public static final String TIME = "TM";
45
        
46
        // UUIDs for core datatypes
47
        
48
        public static final String NUMERIC_UUID = "8d4a4488-c2cc-11de-8d13-0010c6dffd0f";
49
        
50
        public static final String CODED_UUID = "8d4a48b6-c2cc-11de-8d13-0010c6dffd0f";
51
        
52
        public static final String TEXT_UUID = "8d4a4ab4-c2cc-11de-8d13-0010c6dffd0f";
53
        
54
        public static final String N_A_UUID = "8d4a4c94-c2cc-11de-8d13-0010c6dffd0f";
55
        
56
        public static final String DOCUMENT_UUID = "8d4a4e74-c2cc-11de-8d13-0010c6dffd0f";
57
        
58
        public static final String DATE_UUID = "8d4a505e-c2cc-11de-8d13-0010c6dffd0f";
59
        
60
        public static final String TIME_UUID = "8d4a591e-c2cc-11de-8d13-0010c6dffd0f";
61
        
62
        public static final String DATETIME_UUID = "8d4a5af4-c2cc-11de-8d13-0010c6dffd0f";
63
        
64
        public static final String BOOLEAN_UUID = "8d4a5cca-c2cc-11de-8d13-0010c6dffd0f";
65
        
66
        public static final String RULE_UUID = "8d4a5e96-c2cc-11de-8d13-0010c6dffd0f";
67
        
68
        public static final String STRUCTURED_NUMERIC_UUID = "8d4a606c-c2cc-11de-8d13-0010c6dffd0f";
69
        
70
        public static final String COMPLEX_UUID = "8d4a6242-c2cc-11de-8d13-0010c6dffd0f";
71
        
72
        // Fields
73
        private Integer conceptDatatypeId;
74
        
75
        private String hl7Abbreviation;
76
        
77
        // Constructors
78
        
79
        /** default constructor */
80
        public ConceptDatatype() {
1✔
81
        }
1✔
82
        
83
        /** constructor with id */
84
        public ConceptDatatype(Integer conceptDatatypeId) {
1✔
85
                this.conceptDatatypeId = conceptDatatypeId;
1✔
86
        }
1✔
87
        
88
        // Property accessors
89
        
90
        public Integer getConceptDatatypeId() {
91
                return this.conceptDatatypeId;
1✔
92
        }
93
        
94
        public void setConceptDatatypeId(Integer conceptDatatypeId) {
95
                this.conceptDatatypeId = conceptDatatypeId;
1✔
96
        }
1✔
97
        
98
        /**
99
         * @return Returns the hl7Abbreviation.
100
         */
101
        public String getHl7Abbreviation() {
102
                return hl7Abbreviation;
1✔
103
        }
104
        
105
        /**
106
         * @param hl7Abbreviation The hl7Abbreviation to set.
107
         */
108
        public void setHl7Abbreviation(String hl7Abbreviation) {
109
                this.hl7Abbreviation = hl7Abbreviation;
1✔
110
        }
1✔
111
        
112
        /*
113
         * Convenience methods for resolving common data types
114
         */
115

116
        /**
117
         * @return <code>true</code> if datatype is N/A, i.e. this concept is only an answer, not a
118
         *         question
119
         */
120
        public boolean isAnswerOnly() {
UNCOV
121
                return N_A_UUID.equals(getUuid());
×
122
        }
123
        
124
        /**
125
         * @return <code>true</code> if datatype is a numeric datatype
126
         */
127
        public boolean isNumeric() {
128
                return NUMERIC_UUID.equals(getUuid());
1✔
129
        }
130
        
131
        /**
132
         * @return <code>true</code> if datatype is coded (i.e., an identifier from a vocabulary)
133
         */
134
        public boolean isCoded() {
135
                return CODED_UUID.equals(getUuid());
1✔
136
        }
137
        
138
        /**
139
         * @return <code>true</code> if datatype is representation of date (but NOT a time or
140
         *         datatime--see containsDate() and containsTime())
141
         */
142
        public boolean isDate() {
143
                return DATE_UUID.equals(getUuid());
1✔
144
        }
145
        
146
        /**
147
         * @return <code>true</code> if datatype is representation of time
148
         * @since 1.7
149
         */
150
        public boolean isTime() {
151
                return TIME_UUID.equals(getUuid());
1✔
152
        }
153
        
154
        /**
155
         * @return <code>true</code> if datatype is representation of Datetime
156
         * @since 1.7
157
         */
158
        public boolean isDateTime() {
159
                return DATETIME_UUID.equals(getUuid());
1✔
160
        }
161
        
162
        /**
163
         * @return <code>true</code> if datatype is representation of either date or Datetime
164
         * @since 1.7
165
         */
166
        public boolean containsDate() {
UNCOV
167
                return DATE_UUID.equals(getUuid()) || DATETIME_UUID.equals(getUuid());
×
168
        }
169
        
170
        /**
171
         * @return <code>true</code> if datatype is representation of either time or Datetime
172
         * @since 1.7
173
         */
174
        public boolean containsTime() {
UNCOV
175
                return TIME_UUID.equals(getUuid()) || DATETIME_UUID.equals(getUuid());
×
176
        }
177
        
178
        /**
179
         * @return <code>true</code> if datatype is text-based
180
         */
181
        public boolean isText() {
182
                return TEXT_UUID.equals(getUuid()) || DOCUMENT_UUID.equals(getUuid());
1✔
183
        }
184
        
185
        /**
186
         * @return <code>true</code> if datatype is boolean
187
         */
188
        public boolean isBoolean() {
189
                return BOOLEAN_UUID.equals(getUuid());
1✔
190
        }
191
        
192
        /**
193
         * @since 1.5
194
         * @see org.openmrs.OpenmrsObject#getId()
195
         */
196
        @Override
197
        public Integer getId() {
198
                
199
                return getConceptDatatypeId();
1✔
200
        }
201
        
202
        /**
203
         * @since 1.5
204
         * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
205
         */
206
        @Override
207
        public void setId(Integer id) {
UNCOV
208
                setConceptDatatypeId(id);
×
209
                
UNCOV
210
        }
×
211
        
212
        /**
213
         * @return <code>true</code> if datatype is complex
214
         * @since 1.7
215
         */
216
        public boolean isComplex() {
UNCOV
217
                return COMPLEX_UUID.equals(getUuid());
×
218
        }
219
        
220
        /**
221
         * @return <code>true</code> if datatype is a rule
222
         * @since 1.7
223
         */
224
        public boolean isRule() {
UNCOV
225
                return RULE_UUID.equals(getUuid());
×
226
        }
227
        
228
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc