Skip to content

Commit

Permalink
Merge branch 'develop' into fix-rewriting-TestManagementConfigMenu-page
Browse files Browse the repository at this point in the history
  • Loading branch information
adityadeshlahre authored Jan 9, 2025
2 parents 59d6156 + e0a6881 commit 2f75384
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 11 deletions.
6 changes: 3 additions & 3 deletions frontend/cypress/pages/ModifyOrderPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class ModifyOrderPage {

clickRespectivePatient() {
return cy
.get('tbody tr')
.first()
.find('.cds--radio-button__appearance')
.get("tbody tr")
.first()
.find(".cds--radio-button__appearance")
.click();
}
}
Expand Down
39 changes: 33 additions & 6 deletions frontend/src/components/patient/CreatePatientForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,16 @@ function CreatePatientForm(props) {
};

function handleYearsChange(e, values) {
setPatientDetails(values);
let years = e.target.value;
// Ensure years is not negative
const years = Math.max(0, Number(e.target.value));

// Update form values with the validated years
setPatientDetails({
...values,
// Update the specific field that contains years to ensure the form shows the corrected value
[e.target.name]: years,
});

let dobFormatter = {
...dateOfBirthFormatter,
years: years,
Expand All @@ -153,8 +161,16 @@ function CreatePatientForm(props) {
}

function handleMonthsChange(e, values) {
setPatientDetails(values);
let months = e.target.value;
// Ensure months is not negative
const months = Math.max(0, Number(e.target.value));

// Update form values with the validated months
setPatientDetails({
...values,
// Update the specific field that contains months to ensure the form shows the corrected value
[e.target.name]: months,
});

let dobFormatter = {
...dateOfBirthFormatter,
months: months,
Expand All @@ -163,8 +179,16 @@ function CreatePatientForm(props) {
}

function handleDaysChange(e, values) {
setPatientDetails(values);
let days = e.target.value;
// Ensure days is not negative
const days = Math.max(0, Number(e.target.value));

// Update form values with the validated days
setPatientDetails({
...values,
// Update the specific field that contains days to ensure the form shows the corrected value
[e.target.name]: days,
});

let dobFormatter = {
...dateOfBirthFormatter,
days: days,
Expand Down Expand Up @@ -625,6 +649,7 @@ function CreatePatientForm(props) {
})}
id="years"
type="number"
min="0"
onChange={(e) => handleYearsChange(e, values)}
placeholder={intl.formatMessage({
id: "patient.information.age",
Expand All @@ -637,6 +662,7 @@ function CreatePatientForm(props) {
name="months"
labelText={intl.formatMessage({ id: "patient.age.months" })}
type="number"
min="0"
onChange={(e) => handleMonthsChange(e, values)}
id="months"
placeholder={intl.formatMessage({
Expand All @@ -649,6 +675,7 @@ function CreatePatientForm(props) {
value={dateOfBirthFormatter.days}
name="days"
type="number"
min="0"
onChange={(e) => handleDaysChange(e, values)}
labelText={intl.formatMessage({ id: "patient.age.days" })}
id="days"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<minor.version>1</minor.version>
<state.version>0</state.version>
<!-- 0 = alpha, 1 = beta, 2 = rc, 3 = deployable -->
<fix.version>0</fix.version>
<fix.version>1</fix.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<liquibase.propertyFile>${project.basedir}/liquibase/liquibase.properties</liquibase.propertyFile>
<castor.version>1.4.1</castor.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ protected void appendOtherDiseaseCrosstab(Date lowDate, Date highDate, SQLConsta

protected void defineBasicColumns() {
add("accession_number", "LABNO", NONE);
add("lab_unit", "LAB_UNIT", NONE);
add("national_id", "IDENTIFIER", NONE);
add("gender", "SEX", NONE);
add("birth_date", "BIRTHDATE", DATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ protected void appendResultCrosstab(java.sql.Date lowDate, java.sql.Date highDat
+ " join clinlims.sample AS s on s.id = si.samp_id \n"
+ " join clinlims.test_result AS tr on r.test_result_id = tr.id \n"
+ " join clinlims.test AS t on tr.test_id = t.id \n"
+ " join clinlims.test_section ts on t.test_section_id = ts.id \n"
+ " left join sample_projects sp on si.samp_id = sp.samp_id \n" + "\n"
+ " WHERE sp.id IS NULL AND s.entered_date >= date(''" + formatDateForDatabaseSql(lowDate)
+ "'') AND s.entered_date <= date(''" + formatDateForDatabaseSql(highDate) + " '') " + "\n "
Expand Down Expand Up @@ -631,7 +632,11 @@ protected void appendObservationHistoryCrosstab(java.sql.Date lowDate, java.sql.
}

protected void appendCrosstabPreamble(SQLConstant listName) {
query.append(", \n\n ( SELECT s.id AS samp_id, " + listName + ".* " + " FROM sample AS s LEFT JOIN \n ");
query.append(", \n\n ( SELECT s.id AS samp_id, " + " (SELECT ts.name FROM clinlims.test_section ts "
+ " JOIN clinlims.test t ON t.test_section_id = ts.id "
+ " JOIN clinlims.analysis a ON a.test_id = t.id "
+ " WHERE a.sampitem_id = si.id LIMIT 1) as lab_unit, " + listName + ".* " + " FROM sample AS s "
+ " LEFT JOIN sample_item si ON s.id = si.samp_id " + " LEFT JOIN \n ");
}

protected void appendCrosstabPostfix(java.sql.Date lowDate, java.sql.Date highDate, SQLConstant listName) {
Expand Down

0 comments on commit 2f75384

Please sign in to comment.