Skip to content

Commit

Permalink
Merge pull request #78 from openeyes/update-IOL-3.4
Browse files Browse the repository at this point in the history
Update IOLMI to match 3.4 DB
  • Loading branch information
biskyt authored Dec 17, 2019
2 parents 7b61fd6 + 7a0d59e commit 0bfb503
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
1 change: 1 addition & 0 deletions src/resources/hibernate.cfg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<mapping class="uk.org.openeyes.models.EtOphinbiometryMeasurement"/>
<mapping class="uk.org.openeyes.models.EtOphinbiometrySelection"/>
<mapping class="uk.org.openeyes.models.EtOphinbiometryIolRefValues"/>
<mapping class="uk.org.openeyes.models.OphinbiometrySurgeon"/>
<mapping class="uk.org.openeyes.models.OphinbiometryImportedEvents"/>
<mapping class="uk.org.openeyes.models.OphinbiometryCalculationFormula"/>
<mapping class="uk.org.openeyes.models.OphinbiometryLenstypeLens"/>
Expand Down
10 changes: 5 additions & 5 deletions src/uk/org/openeyes/BiometryFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ private void createSelectionData() {
newBasicSelectionData.setLastModifiedUserId(selectedUser);
newBasicSelectionData.setEventId(importedBiometryEvent.getEventId());
newBasicSelectionData.setEyeId(new Eye(eventBiometry.getEyeId()));
newBasicSelectionData.setIolPowerLeft(BigDecimal.ZERO);
newBasicSelectionData.setIolPowerRight(BigDecimal.ZERO);
newBasicSelectionData.setPredictedRefractionLeft(BigDecimal.ZERO);
newBasicSelectionData.setPredictedRefractionRight(BigDecimal.ZERO);
newBasicSelectionData.setIolPowerLeft("0");
newBasicSelectionData.setIolPowerRight("0");
newBasicSelectionData.setPredictedRefractionLeft("0");
newBasicSelectionData.setPredictedRefractionRight("0");
session.save(newBasicSelectionData);
}

Expand Down Expand Up @@ -526,7 +526,7 @@ private OphinbiometryImportedEvents processImportedEvent() {
if (!currentEvent.list().isEmpty()) {
importedEvent = (OphinbiometryImportedEvents) currentEvent.list().get(0);
// if the event is in deleted state we cerate a new record
if(importedEvent.getEventId().getDeleted() == 0){
if(!importedEvent.getEventId().getDeleted()){
dicomLogger.addToRawOutput("StudyID exists in database, merging with existing event...");

importedEvent.setSopUId(eventStudy.getSopUID());
Expand Down
11 changes: 6 additions & 5 deletions src/uk/org/openeyes/models/Disorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
Expand Down Expand Up @@ -46,7 +47,7 @@ public class Disorder implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
private BigInteger id;
@Basic(optional = false)
@Column(name = "fully_specified_name")
private String fullySpecifiedName;
Expand Down Expand Up @@ -79,11 +80,11 @@ public class Disorder implements Serializable {
public Disorder() {
}

public Disorder(Integer id) {
public Disorder(BigInteger id) {
this.id = id;
}

public Disorder(Integer id, String fullySpecifiedName, String term, Date lastModifiedDate, Date createdDate, boolean active) {
public Disorder(BigInteger id, String fullySpecifiedName, String term, Date lastModifiedDate, Date createdDate, boolean active) {
this.id = id;
this.fullySpecifiedName = fullySpecifiedName;
this.term = term;
Expand All @@ -92,11 +93,11 @@ public Disorder(Integer id, String fullySpecifiedName, String term, Date lastMod
this.active = active;
}

public Integer getId() {
public BigInteger getId() {
return id;
}

public void setId(Integer id) {
public void setId(BigInteger id) {
this.id = id;
}

Expand Down
26 changes: 13 additions & 13 deletions src/uk/org/openeyes/models/EtOphinbiometrySelection.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public class EtOphinbiometrySelection implements Serializable {
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Basic(optional = false)
@Column(name = "iol_power_left")
private BigDecimal iolPowerLeft;
private String iolPowerLeft;
@Basic(optional = false)
@Column(name = "predicted_refraction_left")
private BigDecimal predictedRefractionLeft;
private String predictedRefractionLeft;
@Basic(optional = false)
@Column(name = "iol_power_right")
private BigDecimal iolPowerRight;
private String iolPowerRight;
@Basic(optional = false)
@Column(name = "predicted_refraction_right")
private BigDecimal predictedRefractionRight;
private String predictedRefractionRight;
@Basic(optional = false)
@Column(name = "last_modified_date")
@Temporal(TemporalType.TIMESTAMP)
Expand Down Expand Up @@ -99,7 +99,7 @@ public EtOphinbiometrySelection(Integer id) {
this.id = id;
}

public EtOphinbiometrySelection(Integer id, BigDecimal iolPowerLeft, BigDecimal predictedRefractionLeft, BigDecimal iolPowerRight, BigDecimal predictedRefractionRight, Date lastModifiedDate, Date createdDate, boolean deleted, int lensIdLeft, int lensIdRight) {
public EtOphinbiometrySelection(Integer id, String iolPowerLeft, String predictedRefractionLeft, String iolPowerRight, String predictedRefractionRight, Date lastModifiedDate, Date createdDate, boolean deleted, int lensIdLeft, int lensIdRight) {
this.id = id;
this.iolPowerLeft = iolPowerLeft;
this.predictedRefractionLeft = predictedRefractionLeft;
Expand All @@ -120,35 +120,35 @@ public void setId(Integer id) {
this.id = id;
}

public BigDecimal getIolPowerLeft() {
public String getIolPowerLeft() {
return iolPowerLeft;
}

public void setIolPowerLeft(BigDecimal iolPowerLeft) {
public void setIolPowerLeft(String iolPowerLeft) {
this.iolPowerLeft = iolPowerLeft;
}

public BigDecimal getPredictedRefractionLeft() {
public String getPredictedRefractionLeft() {
return predictedRefractionLeft;
}

public void setPredictedRefractionLeft(BigDecimal predictedRefractionLeft) {
public void setPredictedRefractionLeft(String predictedRefractionLeft) {
this.predictedRefractionLeft = predictedRefractionLeft;
}

public BigDecimal getIolPowerRight() {
public String getIolPowerRight() {
return iolPowerRight;
}

public void setIolPowerRight(BigDecimal iolPowerRight) {
public void setIolPowerRight(String iolPowerRight) {
this.iolPowerRight = iolPowerRight;
}

public BigDecimal getPredictedRefractionRight() {
public String getPredictedRefractionRight() {
return predictedRefractionRight;
}

public void setPredictedRefractionRight(BigDecimal predictedRefractionRight) {
public void setPredictedRefractionRight(String predictedRefractionRight) {
this.predictedRefractionRight = predictedRefractionRight;
}

Expand Down
8 changes: 4 additions & 4 deletions src/uk/org/openeyes/models/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class Event implements Serializable {
private String info;
@Basic(optional = false)
@Column(name = "deleted")
private int deleted;
private boolean deleted;
@Column(name = "delete_reason")
private String deleteReason;
@Basic(optional = false)
Expand Down Expand Up @@ -102,7 +102,7 @@ public Event(Integer id) {
this.id = id;
}

public Event(Integer id, Date lastModifiedDate, Date createdDate, Date eventDate, int deleted, boolean deletePending) {
public Event(Integer id, Date lastModifiedDate, Date createdDate, Date eventDate, boolean deleted, boolean deletePending) {
this.id = id;
this.lastModifiedDate = lastModifiedDate;
this.createdDate = createdDate;
Expand Down Expand Up @@ -151,11 +151,11 @@ public void setInfo(String info) {
this.info = info;
}

public int getDeleted() {
public boolean getDeleted() {
return deleted;
}

public void setDeleted(int deleted) {
public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

Expand Down

0 comments on commit 0bfb503

Please sign in to comment.