Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static boolean doMigration(LoggedInInfo loggedInInfo) {

dc.setCreated(relationship.getCreationDate());
dc.setCreator(relationship.getCreator());
dc.setDeleted(relationship.getDeleted() != null && "1".equals(relationship.getDeleted()) ? true : false);
dc.setDeleted(relationship.getDeleted());
dc.setDemographicNo(relationship.getDemographicNo());
dc.setRole(relationship.getRelation());
dc.setContactId(String.valueOf(relationship.getRelationDemographicNo()));
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/oscarehr/common/model/Relationships.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class Relationships extends AbstractModel<Integer> {

private String notes;

private String deleted;
private boolean deleted;

private String creator;

Expand Down Expand Up @@ -143,11 +143,11 @@ public void setNotes(String notes) {
this.notes = notes;
}

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

public void setDeleted(String deleted) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pretty big change going from a boolean to a string - seems intentional. Is it from an upstream commit? Feels like a rebase issue and changing the method isn't the solution maybe?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I made this change was because upstream was using a boolean.

This is what Magenta's main, alpaca, and bullfrog has (link):

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void addDemographicRelationship(String demographic, String linkingDemogra
relationships.setNotes(notes);
relationships.setCreator(providerNo);
relationships.setCreationDate(new Date());
relationships.setDeleted(Boolean.FALSE);
relationships.setDeleted(Boolean.FALSE);

RelationshipsDao dao = SpringUtils.getBean(RelationshipsDao.class);
dao.persist(relationships);
Expand All @@ -65,9 +65,9 @@ public void addDemographicRelationship(String demographic, String linkingDemogra
public void deleteDemographicRelationship(String id) {
RelationshipsDao dao = SpringUtils.getBean(RelationshipsDao.class);
Relationships relationships = dao.find(ConversionUtils.fromIntString(id));
if (relationships == null) MiscUtils.getLogger().error("Unable to find demographic relationship to delete");

if(relationships != null) {
if (relationships == null) {
MiscUtils.getLogger().error("Unable to find demographic relationship to delete");
} else {
relationships.setDeleted(Boolean.TRUE);
dao.merge(relationships);
}
Expand Down