Skip to content

Commit

Permalink
Merge pull request #2 from cc-ar-emr/demographic-relationship-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yingbull authored Nov 5, 2024
2 parents e4d2031 + 2b0fa00 commit 59a011b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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) {
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

0 comments on commit 59a011b

Please sign in to comment.