diff --git a/build.gradle b/build.gradle
index ffbc45c6..8e03e0c4 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,7 +13,8 @@ plugins {
id 'signing'
}
-group = 'io.github.linuxforhealth'
+// group = 'io.github.linuxforhealth'
+group = 'net.fhirfactory.pegacorn'
version = (findProperty('version') == 'unspecified') ? '1.0.1-SNAPSHOT' : version
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 12d38de6..a5f05cc7 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
+distributionUrl=https\://downloads.gradle-dn.com/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 00000000..07d6bf78
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0.0
+
+
+
+
+
+
+
+
+ net.fhirfactory.pegacorn
+ pegacorn
+ 1.5.0-SNAPSHOT
+ ../pegacorn
+
+
+ pegacorn-hl7v2-fhir-converter
+ jar
+ 1.0.1-SNAPSHOT
+
+ Pegacorn :: HL7-FHIR-Converter
+ Converter of HL7 to FHIR JSON
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.commons
+ commons-lang3
+ 3.9
+
+
+ org.apache.commons
+ commons-math3
+ 3.6.1
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.10.1
+
+
+ com.google.guava
+ guava
+ 23.0
+
+
+ commons-io
+ commons-io
+ 2.6
+
+
+ ca.uhn.hapi
+ hapi-base
+ 2.3
+
+
+ ca.uhn.hapi
+ hapi-structures-v26
+ 2.3
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.10.1
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jdk8
+ 2.10.1
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ 2.10.1
+
+
+ org.apache.commons
+ commons-text
+ 1.8
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-structures-r4
+ 5.1.0
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-structures-r5
+ 5.1.0
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-validation
+ 5.1.0
+
+
+ ca.uhn.hapi.fhir
+ hapi-fhir-validation-resources-r4
+ 5.1.0
+
+
+ org.apache.commons
+ commons-jexl3
+ 3.1
+
+
+ org.apache.commons
+ commons-configuration2
+ 2.7
+
+
+ org.apache.commons
+ commons-collections4
+ 4.4
+
+
+ com.ibm.fhir
+ fhir-registry
+ 4.9.0
+
+
+ com.ibm.fhir
+ fhir-term
+ 4.9.0
+
+
+ commons-beanutils
+ commons-beanutils
+ 1.9.4
+
+
+ ch.qos.logback
+ logback-classic
+ 1.2.3
+ test
+
+
+ org.assertj
+ assertj-core
+ 3.9.0
+ test
+
+
+ jakarta.json
+ jakarta.json-api
+ 2.0.1
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ 5.7.2
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-params
+ 5.7.2
+ test
+
+
+
+
+
+
+
+ ch.qos.logback
+ logback-classic
+ ${version-ch.qos.logback-classic}
+ compile
+
+
+
+ ch.qos.logback
+ logback-core
+ ${version-ch.qos.logback-classic}
+ compile
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${version-org.apache.maven-compiler-plugin}
+
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${version-org.apache.maven-surefire-plugin}
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ ${version-org.apache.maven-failsafe-plugin}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ default
+
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${version-org.apache.maven-surefire-plugin}
+
+ true
+
+
+
+
+
+
+
+
diff --git a/src/main/java/io/github/linuxforhealth/hl7/HL7ToFHIRConverter.java b/src/main/java/io/github/linuxforhealth/hl7/HL7ToFHIRConverter.java
index 23f4c3c8..1d164c31 100644
--- a/src/main/java/io/github/linuxforhealth/hl7/HL7ToFHIRConverter.java
+++ b/src/main/java/io/github/linuxforhealth/hl7/HL7ToFHIRConverter.java
@@ -40,6 +40,7 @@
public class HL7ToFHIRConverter {
private static HL7HapiParser hparser = new HL7HapiParser();
private static final Logger LOGGER = LoggerFactory.getLogger(HL7ToFHIRConverter.class);
+ private static final String FALLBACK_BASE = "Fallback_Base"; // fallback configuration file to use when Trigger Event does not match anything (only used if enabled in supported.hl7.messages)
private Map messagetemplates = new HashMap<>();
/**
@@ -130,7 +131,15 @@ public String convert(String hl7MessageData, ConverterOptions options) {
if (hl7MessageTemplateModel != null) {
return hl7MessageTemplateModel.convert(hl7message, engine);
} else {
- throw new UnsupportedOperationException("Message type not yet supported " + messageType);
+ // try to get the our fallback template
+ hl7MessageTemplateModel = messagetemplates.get(FALLBACK_BASE);
+ if (hl7MessageTemplateModel != null) {
+ // fallback template is enabled so use it just like a normal message template model
+ return hl7MessageTemplateModel.convert(hl7message, engine);
+ } else {
+ // it is not enabled by being in the supported.hl7.messages
+ throw new UnsupportedOperationException("Message type not yet supported " + messageType);
+ }
}
} else {
throw new IllegalArgumentException("Parsed HL7 message was null.");
diff --git a/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataTypeMapper.java b/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataTypeMapper.java
index 9238d7c8..27736051 100644
--- a/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataTypeMapper.java
+++ b/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataTypeMapper.java
@@ -44,6 +44,7 @@ public enum SimpleDataTypeMapper {
ALLERGY_INTOLERANCE_CATEGORY(SimpleDataValueResolver.ALLERGY_INTOLERANCE_CATEGORY_CODE_FHIR),
ALLERGY_INTOLERANCE_CRITICALITY(
SimpleDataValueResolver.ALLERGY_INTOLERANCE_CRITICALITY_CODE_FHIR),
+ ALLERGY_INTOLERANCE_TYPE(SimpleDataValueResolver.ALLERGY_INTOLERANCE_TYPE_CODE_FHIR),
ADMINISTRATIVE_GENDER(SimpleDataValueResolver.ADMINISTRATIVE_GENDER_CODE_FHIR),
CONDITION_CATEGORY_CODES(SimpleDataValueResolver.CONDITION_CATEGORY_CODES),
DIAGNOSTIC_REPORT_STATUS(SimpleDataValueResolver.DIAGNOSTIC_REPORT_STATUS_CODES),
diff --git a/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataValueResolver.java b/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataValueResolver.java
index eed27cf1..87e20d49 100644
--- a/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataValueResolver.java
+++ b/src/main/java/io/github/linuxforhealth/hl7/data/SimpleDataValueResolver.java
@@ -32,6 +32,7 @@
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory;
import org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality;
+import org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType;
import org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus;
import org.hl7.fhir.r4.model.Enumerations.AdministrativeGender;
import org.hl7.fhir.r4.model.Immunization.ImmunizationStatus;
@@ -577,6 +578,11 @@ private static final SimpleCode commonCodingSystemV2 (String table, String code,
String val = Hl7DataHandlerUtil.getStringValue(value);
return getFHIRCode(val, AllergyIntoleranceCategory.class);
};
+
+ public static final ValueExtractor