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

openmrs / openmrs-core / 15320461151

29 May 2025 09:11AM UTC coverage: 65.013%. Remained the same
15320461151

push

github

web-flow
TRUNK-5893: VisitType Domain - Switching from Hibernate Mappings to Annotations (#5023)

23354 of 35922 relevant lines covered (65.01%)

0.65 hits per line

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

73.33
/api/src/main/java/org/openmrs/VisitType.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.GeneratedValue;
15
import javax.persistence.GenerationType;
16
import javax.persistence.Id;
17
import javax.persistence.Table;
18

19
import org.hibernate.envers.Audited;
20

21
/**
22
 * Represents the assortment of visit types available to an implementation. These could include
23
 * items like "Initial HIV Clinic Visit", "Return TB Clinic Visit", and "Hospitalization".
24
 * 
25
 * @since 1.9
26
 */
27
@Entity
28
@Table(name = "visit_type")
29
@Audited
30
public class VisitType extends BaseChangeableOpenmrsMetadata {
31
        
32
        private static final long serialVersionUID = 1L;
33
        
34
        @Id
35
        @GeneratedValue(strategy = GenerationType.IDENTITY)
36
        @Column(name = "visit_type_id")
37
        private Integer visitTypeId;
38
        
39
        /** default constructor */
40
        public VisitType() {
1✔
41
        }
1✔
42
        
43
        /**
44
         * Constructor with id
45
         * 
46
         * <strong>Should</strong> set visit type id with given parameter
47
         */
48
        public VisitType(Integer visitTypeId) {
1✔
49
                this.visitTypeId = visitTypeId;
1✔
50
        }
1✔
51
        
52
        /**
53
         * Required values constructor. This is the minimum number of values that must be non-null in
54
         * order to have a successful save to the database
55
         * 
56
         * @param name the name of this visit type
57
         * @param description a short description of why this visit type exists
58
         */
59
        public VisitType(String name, String description) {
1✔
60
                setName(name);
1✔
61
                setDescription(description);
1✔
62
        }
1✔
63
        
64
        /**
65
         * @return Returns the visitTypeId.
66
         */
67
        public Integer getVisitTypeId() {
68
                return visitTypeId;
1✔
69
        }
70
        
71
        /**
72
         * @param visitTypeId the visitTypeId to set.
73
         */
74
        public void setVisitTypeId(Integer visitTypeId) {
75
                this.visitTypeId = visitTypeId;
×
76
        }
×
77
        
78
        /**
79
         * @see org.openmrs.OpenmrsObject#getId()
80
         */
81
        @Override
82
        public Integer getId() {
83
                return getVisitTypeId();
1✔
84
        }
85
        
86
        /**
87
         * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
88
         */
89
        @Override
90
        public void setId(Integer id) {
91
                setVisitTypeId(id);
×
92
        }
×
93
        
94
}
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