-
Notifications
You must be signed in to change notification settings - Fork 3
/
Surgery.java
138 lines (101 loc) · 3.13 KB
/
Surgery.java
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
package org.openmrs.module.operationtheater;
import org.openmrs.*;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.Set;
import org.openmrs.module.operationtheater.attribute.converter.time.LocalDateTimeAttributeConverter;
/**
* Defines a Surgery in the system.
*/
@Entity
@Table(name = "surgery")
public class Surgery extends BaseOpenmrsDataJPA {
@Id
@GeneratedValue
@Column(name = "surgery_id")
private Integer surgeryId;
@ManyToOne
@JoinColumn(name = "patient_id", nullable = false)
private Patient patient;
@ManyToOne
@JoinColumn(name = "procedure_id", nullable = false)
private Procedure procedure;
@Column(name = "date_started")
@Convert( converter = LocalDateTimeAttributeConverter.class)
private LocalDateTime dateStarted;
@Column(name = "date_finished")
@Convert( converter = LocalDateTimeAttributeConverter.class)
private LocalDateTime dateFinished;
@OneToOne(cascade = { CascadeType.ALL })
@JoinColumn(name = "scheduling_data_id")
private SchedulingData schedulingData;
@ManyToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinTable(name = "surgical_team",
joinColumns = { @JoinColumn(name = "surgery_id", nullable = false, updatable = false) },
inverseJoinColumns = { @JoinColumn(name = "provider_id", nullable = false, updatable = false) })
private Set<Provider> surgicalTeam;
@OneToOne(cascade = { CascadeType.ALL })
@JoinTable(name = "surgery_info_obs",
joinColumns = { @JoinColumn(name="surgery_id", referencedColumnName = "surgery_id", nullable = true, updatable = true) },
inverseJoinColumns = { @JoinColumn(name = "obs_group_id", referencedColumnName = "obs_id", nullable = true, updatable = true) })
private Obs SurgeryObsGroup;
public int getSurgeryId() {
return surgeryId;
}
public void setSurgeryId(int surgeryId) {
this.surgeryId = surgeryId;
}
@Override
public Integer getId() {
return getSurgeryId();
}
@Override
public void setId(Integer integer) {
setSurgeryId(integer);
}
public Patient getPatient() {
return patient;
}
public void setPatient(Patient patient) {
this.patient = patient;
}
public Procedure getProcedure() {
return procedure;
}
public void setProcedure(Procedure procedure) {
this.procedure = procedure;
}
public boolean isSurgeryCompleted() {
return dateFinished != null;
}
public SchedulingData getSchedulingData() {
return schedulingData;
}
public void setSchedulingData(SchedulingData schedulingData) {
this.schedulingData = schedulingData;
}
public Set<Provider> getSurgicalTeam() {
return surgicalTeam;
}
public void setSurgicalTeam(Set<Provider> surgicalTeam) {
this.surgicalTeam = surgicalTeam;
}
public Obs getSurgeryObsGroup() {
return SurgeryObsGroup;
}
public void setSurgeryObsGroup(Obs surgeryObsGroup) {
SurgeryObsGroup = surgeryObsGroup;
}
public LocalDateTime getDateFinished() {
return dateFinished;
}
public void setDateFinished(LocalDateTime dateFinished) {
this.dateFinished = dateFinished;
}
public LocalDateTime getDateStarted() {
return dateStarted;
}
public void setDateStarted(LocalDateTime dateStarted) {
this.dateStarted = dateStarted;
}
}