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

Origin/null display #328

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions src/main/java/io/github/linuxforhealth/core/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Constants {
public static final String HL7_BASE_PATH = "hl7/";
public static final String FHIR_BASE_PATH = "fhir/";
public static final String MESSAGE_BASE_PATH = "message/";
public static final String NULL_VAR_NAME = "NULL";

private Constants() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum SimpleDataTypeMapper {
CODING_SYSTEM_V2_ALTERNATE(SimpleDataValueResolver.CODING_SYSTEM_V2_ALTERNATE),
CODING_SYSTEM_V2_IDENTIFIER(SimpleDataValueResolver.CODING_SYSTEM_V2_IDENTIFIER),
CODING_SYSTEM_V2_IS_USER_DEFINED_TABLE(SimpleDataValueResolver.CODING_SYSTEM_V2_IS_USER_DEFINED_TABLE),
NO_DISPLAY(SimpleDataValueResolver.NO_DISPLAY),
SYSTEM_URL(SimpleDataValueResolver.SYSTEM_URL),
SYSTEM_ID(SimpleDataValueResolver.SYSTEM_ID),
PV1_DURATION_LENGTH(SimpleDataValueResolver.PV1_DURATION_LENGTH),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ private static final SimpleCode commonCodingSystemV2 (String table, String code,
}
}

public static final ValueExtractor<Object, String> NO_DISPLAY = (Object value) -> {
if (value == "no display") { return null; };
return null;
};
public static final ValueExtractor<Object, String> BUILD_IDENTIFIER_FROM_CWE = (Object value) -> {
CWE newValue = ((CWE) value);
String identifier = newValue.getCwe1_Identifier().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.github.linuxforhealth.api.EvaluationResult;
import io.github.linuxforhealth.api.Expression;
import io.github.linuxforhealth.api.InputDataExtractor;
import io.github.linuxforhealth.api.ResourceValue;
import io.github.linuxforhealth.core.Constants;
import io.github.linuxforhealth.core.ObjectMapperUtil;
import io.github.linuxforhealth.core.exception.DataExtractionException;
import io.github.linuxforhealth.core.exception.RequiredConstraintFailureException;
Expand Down Expand Up @@ -57,6 +56,7 @@ public static ResourceEvaluationResult evaluate(InputDataExtractor dataSource,
try {
Map<String, Expression> expressionsToEvaluateLater = new HashMap<>();
Map<String, EvaluationResult> localContext = new HashMap<>(context);
localContext.put(Constants.NULL_VAR_NAME, new EmptyEvaluationResult());
// initialize the map and list to collect values
List<ResourceValue> additionalResolveValues = new ArrayList<>();
Map<String, Object> resolveValues = new HashMap<>();
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/hl7/extension/ExtensionMeta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ extension_5:
vars:
system: SYSTEM_URL, $system_code
code: String, MSH.9.1
display: $NULL
constants:
system_code: 'source-record-type-system'


extension_6:
generateList: true
Expand All @@ -67,5 +69,7 @@ extension_6:
vars:
system: SYSTEM_URL, $system_code
code: String, MSH.9.2
display: $NULL
constants:
system_code: 'source-event-trigger-system'
system_code: 'source-event-trigger-system'