Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix medication request script hull #76

Merged
merged 2 commits into from
Sep 2, 2024
Merged
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 @@ -5,10 +5,12 @@ import de.kairos.centraxx.fhir.r4.utils.FhirUrls
import de.kairos.fhir.centraxx.metamodel.Episode
import de.kairos.fhir.centraxx.metamodel.enums.DatePrecision
import de.kairos.fhir.centraxx.metamodel.enums.MedicationServiceType
import org.apache.commons.lang3.StringUtils
import org.hl7.fhir.r4.model.MedicationAdministration

import static de.kairos.fhir.centraxx.metamodel.AbstractIdContainer.PSN
import static de.kairos.fhir.centraxx.metamodel.RootEntities.medication

/**
* Represents a CXX Medication
*
Expand Down Expand Up @@ -203,7 +205,7 @@ static String convertPrecision(final String cxxPrecision) {
}

static BigDecimal sanitizeScale(final String numeric) {
return numeric == null ? null : new BigDecimal(numeric).stripTrailingZeros()
return numeric == null || StringUtils.isNumeric(numeric) ? null : new BigDecimal(numeric).stripTrailingZeros()
}

static boolean isFakeEpisode(final def episode) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package projects.patientfinder


import de.kairos.centraxx.fhir.r4.utils.FhirUrls
import de.kairos.fhir.centraxx.metamodel.Episode
import de.kairos.fhir.centraxx.metamodel.enums.FhirDoseTypeEnum
import de.kairos.fhir.centraxx.metamodel.enums.MedicationKind
import de.kairos.fhir.centraxx.metamodel.enums.MedicationServiceType
import org.apache.commons.lang3.StringUtils
import org.hl7.fhir.r4.model.MedicationRequest

import static de.kairos.fhir.centraxx.metamodel.AbstractIdContainer.PSN
import static de.kairos.fhir.centraxx.metamodel.RootEntities.medication

/**
* Represents a CXX Medication
*
Expand Down Expand Up @@ -255,7 +256,7 @@ static Boolean createAsNeededFromType(final String resultStatus) {
}

static BigDecimal sanitizeScale(final String numeric) {
return numeric == null ? null : new BigDecimal(numeric).stripTrailingZeros()
return numeric == null || !StringUtils.isNumeric(numeric) ? null : new BigDecimal(numeric).stripTrailingZeros()
}

static boolean isFakeEpisode(final def episode) {
Expand Down