From 474f84c903b774a87f4c9e4c9dfbad58f8c3cb5a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 9 Dec 2022 20:09:01 +1100 Subject: [PATCH] fix bug doing version comparison --- .../main/java/org/hl7/fhir/utilities/VersionUtilities.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java index 2df607c7d..05e19a716 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/VersionUtilities.java @@ -311,7 +311,12 @@ public class VersionUtilities { return true; } if (pc!=null) { - return compareVersionPart(pt, pc); + if (pt.contains("-") && !pc.contains("-")) { + pt = pt.substring(0, pt.indexOf("-")); + return pt.compareTo(pc) >= 0; + } else { + return compareVersionPart(pt, pc); + } } } return false;