Skip to content
Open
Show file tree
Hide file tree
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 @@ -23,6 +23,9 @@
import dev.ikm.tinkar.coordinate.view.calculator.ViewCalculator;
import dev.ikm.tinkar.terms.TinkarTerm;
import javafx.event.ActionEvent;

import java.math.BigDecimal;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -39,8 +42,8 @@ public AddIntervalRole(String text, AxiomSubjectRecord axiomSubjectRecord, ViewC
@Override
public void doAction(ActionEvent t, AxiomSubjectRecord axiomSubjectRecord, EditCoordinateRecord editCoordinate) {
LogicalExpressionBuilder leb = new LogicalExpressionBuilder(axiomSubjectRecord.axiomTree());
LogicalAxiom.Atom.TypedAtom.IntervalRole role = leb.IntervalRole(TinkarTerm.UNMODELED_ROLE_CONCEPT, 0, true, 10,
true, TinkarTerm.UNMODELED_ROLE_CONCEPT);
LogicalAxiom.Atom.TypedAtom.IntervalRole role = leb.IntervalRole(TinkarTerm.UNMODELED_ROLE_CONCEPT,
new BigDecimal(0), true, new BigDecimal(10), true, TinkarTerm.UNMODELED_ROLE_CONCEPT);
leb.addToFirstAnd(axiomSubjectRecord.axiomIndex(), role);
putUpdatedLogicalExpression(editCoordinate, leb.build());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package dev.ikm.komet.rules.actions.axiom;

import java.math.BigDecimal;
import java.util.Optional;

import dev.ikm.elk.snomed.interval.Interval;
Expand Down Expand Up @@ -56,14 +57,14 @@ public void doAction(ActionEvent t, AxiomSubjectRecord axiomSubjectRecord, EditC
if (!result.isPresent())
return;
try {
int value = Integer.parseInt(result.get());
BigDecimal value = new BigDecimal(result.get());
if (lower) {
interval.setLowerBound(value);
} else {
interval.setUpperBound(value);
}
} catch (NumberFormatException ex) {
new Alert(AlertType.ERROR, "Enter an integer").showAndWait();
new Alert(AlertType.ERROR, "Enter an integer or decimal ").showAndWait();
return;
}
LogicalExpressionBuilder leb = new LogicalExpressionBuilder(axiomSubjectRecord.axiomTree());
Expand Down
Loading