Skip to content

Commit

Permalink
Merge pull request #6662 from hmislk/Issue#6433
Browse files Browse the repository at this point in the history
Issue#6433 Closes #6433
  • Loading branch information
DeshaniPubudu committed Jul 29, 2024
2 parents c9a7698 + 1198ba6 commit a88b2c4
Show file tree
Hide file tree
Showing 14 changed files with 975 additions and 322 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
11
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>
<artifactId>sethmademo1</artifactId>
<artifactId>ruhunu-demo</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>sethmademo1</name>
<name>ruhunu-demo</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand Down
254 changes: 201 additions & 53 deletions src/main/java/com/divudi/bean/common/OpdPreSettleController.java

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main/java/com/divudi/bean/common/SessionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ public class SessionController implements Serializable, HttpSessionListener {

private static final long serialVersionUID = 1L;
WebUser loggedUser = null;
@Deprecated
private UserPreference loggedPreference;
private UserPreference applicationPreference;
@Deprecated
private UserPreference institutionPreference;
private UserPreference departmentPreference;
private UserPreference userPreference;
Expand Down Expand Up @@ -1906,7 +1904,7 @@ public UserPreference getLoggedPreference() {
return loggedPreference;
}

@Deprecated

public void setLoggedPreference(UserPreference loggedPreference) {
this.loggedPreference = loggedPreference;
}
Expand Down Expand Up @@ -2069,10 +2067,12 @@ public void setWebsiteUserGoingToLog(boolean websiteUserGoingToLog) {
}

public UserPreference getDepartmentPreference() {
//System.out.println("getting departmentPreference = " + departmentPreference);
return departmentPreference;
}

public void setDepartmentPreference(UserPreference departmentPreference) {
System.out.println("setting departmentPreference = " + departmentPreference);
this.departmentPreference = departmentPreference;
}

Expand Down
19 changes: 19 additions & 0 deletions src/main/java/com/divudi/bean/lab/PatientSampleController.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,25 @@ public PatientSample getCurrent() {
return current;
}

public String navigateToViewPatientSample(PatientSample ps) {
if (ps == null) {
JsfUtil.addErrorMessage("Nothing selected");
return null;
}
current = ps;
return "/lab/patient_sample?faces-redirect=true;";

}

public String navigateToEditPatientSample(PatientSample ps) {
if (ps == null) {
JsfUtil.addErrorMessage("Nothing selected");
return null;
}
current = ps;
return "/lab/patient_sample_edit?faces-redirect=true;";
}

public PatientSample getAnyPatientSample() {
return getItems().get(0);
}
Expand Down
43 changes: 43 additions & 0 deletions src/main/java/com/divudi/entity/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ public class Person implements Serializable {
@Transient
String ageAsString;
@Transient
private String ageAsShortString;
@Transient
long ageInDays;
@Transient
int serealNumber;
Expand Down Expand Up @@ -215,6 +217,39 @@ public void calAgeFromDob() {
ageYearsComponent = years;
}

public void calShortAgeFromDob() {
ageAsShortString = "";
ageInDays = 0L;
if (getDob() == null) {
return;
}

LocalDate ldDob = new LocalDate(getDob());
LocalDate currentDate = LocalDate.now();

Period period = new Period(ldDob, currentDate, PeriodType.yearMonthDay());

int years = period.getYears();
int months = period.getMonths();
int days = period.getDays();

if (years > 5) {
ageAsString = years + "Y";
} else if (years > 0) {
ageAsString = years + "Y" + months + "M";
} else if (months > 0) {
ageAsString = months + "M" + days + "d";
} else {
ageAsString = days + "d";
}

period = new Period(ldDob, currentDate, PeriodType.days());
ageInDays = (long) period.getDays();
ageDaysComponent = days;
ageMonthsComponent = months;
ageYearsComponent = years;
}

public void calDobFromAge() {
LocalDate currentDate = new LocalDate();
LocalDate ldDob = currentDate.minusYears(ageYearsComponent).minusMonths(ageMonthsComponent).minusDays(ageDaysComponent);
Expand Down Expand Up @@ -652,4 +687,12 @@ public void setSmsNumber(String smsNumber) {
this.smsNumber = smsNumber;
}

public String getAgeAsShortString() {
calShortAgeFromDob();
if (ageAsShortString == null || ageAsShortString.trim().equals("")) {
ageAsShortString = "";
}
return ageAsShortString;
}

}
44 changes: 44 additions & 0 deletions src/main/java/com/divudi/entity/lab/PatientSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ public class PatientSample implements Serializable {
private Department receivedFromAnalyzerDepartment;
@ManyToOne
private Institution receivedFromAnalyzerInstitution;
@ManyToOne
private PatientSample duplicatedFrom;
@ManyToOne
private PatientSample duplicatedTo;
@ManyToOne
private PatientSample divertedFrom;
@ManyToOne
private PatientSample divertedTo;

//
@ManyToOne
Expand All @@ -97,6 +105,10 @@ public class PatientSample implements Serializable {
private Machine machine;
@ManyToOne
private Sample sample;




//Cancellation
private Boolean cancelled = false;
@ManyToOne
Expand Down Expand Up @@ -484,6 +496,38 @@ public void setRetireComments(String retireComments) {
this.retireComments = retireComments;
}

public PatientSample getDuplicatedFrom() {
return duplicatedFrom;
}

public void setDuplicatedFrom(PatientSample duplicatedFrom) {
this.duplicatedFrom = duplicatedFrom;
}

public PatientSample getDuplicatedTo() {
return duplicatedTo;
}

public void setDuplicatedTo(PatientSample duplicatedTo) {
this.duplicatedTo = duplicatedTo;
}

public PatientSample getDivertedFrom() {
return divertedFrom;
}

public void setDivertedFrom(PatientSample divertedFrom) {
this.divertedFrom = divertedFrom;
}

public PatientSample getDivertedTo() {
return divertedTo;
}

public void setDivertedTo(PatientSample divertedTo) {
this.divertedTo = divertedTo;
}



}
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">
<jta-data-source>jdbc/sethma</jta-data-source>
<jta-data-source>jdbc/arogya</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand All @@ -10,7 +10,7 @@
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/sethmaaudit</jta-data-source>
<jta-data-source>jdbc/arogyaAudit</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0.20240728.11
3.0.0.20240728.11
Loading

0 comments on commit a88b2c4

Please sign in to comment.