Skip to content

Commit

Permalink
Bindu, Rakesh | MOBN-1423 | Error in bahmni-mart bed_management_locat…
Browse files Browse the repository at this point in the history
…ions_view (#32)
  • Loading branch information
binduak authored Aug 13, 2020
1 parent 96a037f commit b44c8b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/procedureSql/dischargeDateProc.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ FROM bed_patient_assignment_default bpam
WHERE bpam.location = locationName
AND patient_id = patientId AND date_started = dateStopped
LIMIT 1;
if current_patient = patientId AND curr_start_date = dateStopped THEN
if current_patient = patientId AND curr_start_date = dateStopped AND curr_start_date != curr_stop_date THEN
RETURN discharge_date(current_patient, locationName, curr_stop_date);
ELSE
RETURN dateStopped;
END IF ;
END;
$$ LANGUAGE plpgsql;
$$ LANGUAGE plpgsql;

0 comments on commit b44c8b9

Please sign in to comment.