Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 committed Jan 5, 2025
1 parent acf629e commit e896f2e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.hl7.fhir.r4.model.Quantity;

import java.math.BigDecimal;
import java.text.MessageFormat;
import com.ibm.icu.text.MessageFormat;
import java.util.List;
import java.util.ResourceBundle;
import java.util.concurrent.CompletableFuture;
Expand All @@ -19,7 +19,6 @@ public final class QuantityToString {

public static CompletableFuture<String> convert(ResourceBundle bundle, FDUConfig config, Quantity quantity) {
var comparator = comparatorToString(bundle, config, quantity);
//var unit = unitToString(config, quantity);
var unit = hasUnit(quantity)
? enhancedFromFHIRQuantityUnitToString(bundle, config, quantity)
: CompletableFuture.completedFuture("");
Expand Down Expand Up @@ -47,7 +46,7 @@ public static CompletableFuture<String> enhancedFromFHIRQuantityUnitToString(Res
String code = quantity.getCode();
BigDecimal amount = quantity.hasValue() ? quantity.getValue() : BigDecimal.ONE;
String message = bundle.getString("withoutCount." + code);
return com.ibm.icu.text.MessageFormat.format(message, amount);
return MessageFormat.format(message, amount);
});
}

Expand All @@ -64,4 +63,4 @@ private static CompletableFuture<String> comparatorToString(ResourceBundle bundl
}
return CompletableFuture.completedFuture("");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package jy95.fhir.r4.dosage.utils.functions;

import jy95.fhir.r4.dosage.utils.config.FDUConfig;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Ratio;

import java.math.BigDecimal;
import java.text.MessageFormat;
import java.util.Map;
import com.ibm.icu.text.MessageFormat;
import java.util.ResourceBundle;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -71,5 +69,4 @@ private static CompletableFuture<String> turnDenominatorToText(

return QuantityToString.convert(bundle, config, denominator);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jy95.fhir.r4.dosage.utils.functions.QuantityToString;
import org.hl7.fhir.r4.model.Dosage;

import java.text.MessageFormat;
import com.ibm.icu.text.MessageFormat;
import java.util.concurrent.CompletableFuture;

public class MaxDosePerAdministration extends AbstractTranslator {
Expand All @@ -23,12 +23,12 @@ public CompletableFuture<String> convert(Dosage dosage) {
.convert(bundle, getConfig(), quantity)
.thenApplyAsync((quantityText) -> {
String msg = bundle.getString("fields.maxDosePerAdministration");
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] {quantityText});
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] { quantityText });
});
}

@Override
public boolean isPresent(Dosage dosage) {
return dosage.hasMaxDosePerAdministration();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jy95.fhir.r4.dosage.utils.functions.QuantityToString;
import org.hl7.fhir.r4.model.Dosage;

import java.text.MessageFormat;
import com.ibm.icu.text.MessageFormat;
import java.util.concurrent.CompletableFuture;

public class MaxDosePerLifetime extends AbstractTranslator {
Expand All @@ -23,12 +23,12 @@ public CompletableFuture<String> convert(Dosage dosage) {
.convert(bundle, getConfig(), quantity)
.thenApplyAsync((quantityText) -> {
String msg = bundle.getString("fields.maxDosePerLifetime");
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] {quantityText});
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] { quantityText });
});
}

@Override
public boolean isPresent(Dosage dosage) {
return dosage.hasMaxDosePerLifetime();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jy95.fhir.r4.dosage.utils.functions.RatioToString;
import org.hl7.fhir.r4.model.Dosage;

import java.text.MessageFormat;
import com.ibm.icu.text.MessageFormat;
import java.util.concurrent.CompletableFuture;

public class MaxDosePerPeriod extends AbstractTranslator {
Expand All @@ -23,12 +23,12 @@ public CompletableFuture<String> convert(Dosage dosage) {
.convert(bundle, getConfig(), ratio)
.thenApplyAsync((ratioText) -> {
String msg = bundle.getString("fields.maxDosePerPeriod");
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] {ratioText});
return new MessageFormat(msg, getConfig().getLocale()).format(new Object[] { ratioText });
});
}

@Override
public boolean isPresent(Dosage dosage) {
return dosage.hasMaxDosePerPeriod();
}
}
}

0 comments on commit e896f2e

Please sign in to comment.