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

openmrs / openmrs-core / 29611767089

17 Jul 2026 08:35PM UTC coverage: 64.031% (+0.2%) from 63.842%
29611767089

push

github

web-flow
TRUNK-6516: Follow-up: fix tests (#6344)

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

131 existing lines in 15 files now uncovered.

24230 of 37841 relevant lines covered (64.03%)

0.64 hits per line

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

45.45
/api/src/main/java/org/openmrs/DrugReferenceMap.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.Column;
13
import javax.persistence.Entity;
14
import javax.persistence.FetchType;
15
import javax.persistence.GeneratedValue;
16
import javax.persistence.GenerationType;
17
import javax.persistence.Id;
18
import javax.persistence.JoinColumn;
19
import javax.persistence.ManyToOne;
20
import javax.persistence.Table;
21
import java.io.Serializable;
22
import java.util.Date;
23

24
import org.hibernate.annotations.Cascade;
25
import org.hibernate.annotations.CascadeType;
26
import org.hibernate.annotations.GenericGenerator;
27
import org.hibernate.annotations.Parameter;
28
import org.hibernate.envers.Audited;
29
import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate;
30
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId;
31
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded;
32
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency;
33

34
/**
35
 * The DrugReferenceMap map object represents a mapping between a drug and alternative drug
36
 * terminologies.
37
 *
38
 * @since 1.10
39
 */
40
@Entity
41
@Table(name="drug_reference_map")
42
@Audited
43
public class DrugReferenceMap extends BaseOpenmrsObject implements Auditable, Serializable {
44

45
        public static final long serialVersionUID = 1L;
46

47
        @Id
48
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "drug_reference_map_id_seq")
49
        @GenericGenerator(
50
                name = "drug_reference_map_id_seq",
51
                strategy = "native",
52
                parameters = @Parameter(name = "sequence", value = "drug_reference_map_drug_reference_map_id_seq")
53
        )
54
        @DocumentId
55
        @Column(name = "drug_reference_map_id")
56
        private Integer drugReferenceMapId;
57

58
        @ManyToOne
59
        @JoinColumn(name = "drug_id", nullable = false)
60
        private Drug drug;
61

62
        @ManyToOne
63
        @JoinColumn(name = "term_id", nullable = false)
64
        @Cascade(CascadeType.SAVE_UPDATE)
65
        @IndexedEmbedded(includeEmbeddedObjectId = true)
66
        @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
67
        private ConceptReferenceTerm conceptReferenceTerm;
68

69
        @ManyToOne
70
        @JoinColumn(name = "concept_map_type", nullable = false)
71
        private ConceptMapType conceptMapType;
72

73
        @ManyToOne(fetch = FetchType.LAZY)
74
        @JoinColumn(name = "creator", nullable = false)
75
        private User creator;
76

77
        @Column(name = "date_created", nullable = false, length = 19)
78
        private Date dateCreated;
79

80
        @ManyToOne(fetch = FetchType.LAZY)
81
        @JoinColumn(name = "changed_by")
82
        private User changedBy;
83

84
        @Column(name = "date_changed", length = 19)
85
        private Date dateChanged;
86

87
        /** default constructor */
88
        public DrugReferenceMap() {
1✔
89
        }
1✔
90

91
        /**
92
         * @param term
93
         * @param conceptMapType
94
         */
95
        public DrugReferenceMap(ConceptReferenceTerm term, ConceptMapType conceptMapType) {
1✔
96
                this.conceptReferenceTerm = term;
1✔
97
                this.conceptMapType = conceptMapType;
1✔
98
        }
1✔
99

100
        /**
101
         * @return Returns the drugReferenceMapId.
102
         */
103
        public Integer getDrugReferenceMapId() {
UNCOV
104
                return drugReferenceMapId;
×
105
        }
106

107
        /**
108
         * @param drugReferenceMapId The drugReferenceMapId to set.
109
         */
110
        public void setDrugReferenceMapId(Integer drugReferenceMapId) {
111
                this.drugReferenceMapId = drugReferenceMapId;
×
UNCOV
112
        }
×
113

114
        /**
115
         * @return Returns the drug.
116
         */
117
        public Drug getDrug() {
118
                return drug;
1✔
119
        }
120

121
        /**
122
         * @param drug The drug to set.
123
         */
124
        public void setDrug(Drug drug) {
125
                this.drug = drug;
1✔
126
        }
1✔
127

128
        /**
129
         * @return Returns the conceptReferenceTerm.
130
         */
131
        public ConceptReferenceTerm getConceptReferenceTerm() {
132
                return conceptReferenceTerm;
1✔
133
        }
134

135
        /**
136
         * @param conceptReferenceTerm The conceptReferenceTerm to set.
137
         */
138
        public void setConceptReferenceTerm(ConceptReferenceTerm conceptReferenceTerm) {
139
                this.conceptReferenceTerm = conceptReferenceTerm;
1✔
140
        }
1✔
141

142
        /**
143
         * @return Returns the conceptMapType.
144
         */
145
        public ConceptMapType getConceptMapType() {
146
                return conceptMapType;
1✔
147
        }
148

149
        /**
150
         * @param conceptMapType The conceptMapType to set.
151
         */
152
        public void setConceptMapType(ConceptMapType conceptMapType) {
153
                this.conceptMapType = conceptMapType;
1✔
154
        }
1✔
155

156
        /**
157
         * @return id - The unique Identifier for the object
158
         */
159
        @Override
160
        public Integer getId() {
UNCOV
161
                return getDrugReferenceMapId();
×
162
        }
163

164
        /**
165
         * @param id - The unique Identifier for the object
166
         */
167
        @Override
168
        public void setId(Integer id) {
169
                setDrugReferenceMapId(id);
×
UNCOV
170
        }
×
171

172
        /**
173
         * @return User - the user who created the object
174
         */
175
        @Override
176
        public User getCreator() {
UNCOV
177
                return this.creator;
×
178
        }
179

180
        /**
181
         * @param creator - the user who created the object
182
         */
183
        @Override
184
        public void setCreator(User creator) {
185
                this.creator = creator;
×
UNCOV
186
        }
×
187

188
        /**
189
         * @return Date - the date the object was created
190
         */
191
        @Override
192
        public Date getDateCreated() {
UNCOV
193
                return dateCreated;
×
194
        }
195

196
        /**
197
         * @param dateCreated - the date the object was created
198
         */
199
        @Override
200
        public void setDateCreated(Date dateCreated) {
201
                this.dateCreated = dateCreated;
×
UNCOV
202
        }
×
203

204
        /**
205
         * @return User - the user who last changed the object
206
         */
207
        @Override
208
        public User getChangedBy() {
UNCOV
209
                return this.changedBy;
×
210
        }
211

212
        /**
213
         * @param changedBy - the user who last changed the object
214
         */
215
        @Override
216
        public void setChangedBy(User changedBy) {
217
                this.changedBy = changedBy;
×
UNCOV
218
        }
×
219

220
        /**
221
         * @return Date - the date the object was last changed
222
         */
223
        @Override
224
        public Date getDateChanged() {
UNCOV
225
                return this.dateChanged;
×
226
        }
227

228
        /**
229
         * @param dateChanged - the date the object was last changed
230
         */
231
        @Override
232
        public void setDateChanged(Date dateChanged) {
233
                this.dateChanged = dateChanged;
×
UNCOV
234
        }
×
235
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc