Skip to content
Merged
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 @@ -2883,17 +2883,21 @@
private int calculateQtyPrescribed(String form, String dose, String frequency, String duration,
String durationUnit) {
int qtyPrescribed = 0;

logger.info("Frequecy", frequency);

Check warning on line 2886 in src/main/java/com/iemr/tm/service/common/transaction/CommonNurseServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

String contains no format specifiers.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-API&issues=AZr-KLVzXm1SJ0fKBx3l&open=AZr-KLVzXm1SJ0fKBx3l&pullRequest=112
if (form != null && dose != null && frequency != null && duration != null && durationUnit != null) {
double qtyInOneDay = getQtyForOneDay(form, dose, frequency);

if (durationUnit.equalsIgnoreCase("Day(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * qtyInOneDay);
else if (durationUnit.equalsIgnoreCase("Week(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 7 * qtyInOneDay);
else if (durationUnit.equalsIgnoreCase("Month(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 30 * qtyInOneDay);

if (frequency.equalsIgnoreCase("Single Dose") || frequency.equalsIgnoreCase("Stat Dose")) {
qtyPrescribed = (int) Math.ceil(qtyInOneDay);
} else {
if (durationUnit.equalsIgnoreCase("Day(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * qtyInOneDay);
else if (durationUnit.equalsIgnoreCase("Week(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 7 * qtyInOneDay);
else if (durationUnit.equalsIgnoreCase("Month(s)"))
qtyPrescribed = (int) Math.ceil(Integer.parseInt(duration) * 30 * qtyInOneDay);
}

}

return qtyPrescribed;
Expand Down
Loading