Restore functionality of -sct parameter to validator

This commit is contained in:
Grahame Grieve 2020-06-14 07:07:18 +10:00
parent 0172475576
commit 3d481f1b05
2 changed files with 10 additions and 53 deletions

View File

@ -2,7 +2,6 @@ package org.hl7.fhir.validation.cli.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hl7.fhir.validation.Validator;
import org.hl7.fhir.validation.cli.utils.SnomedVersion;
import java.util.*;
@ -47,7 +46,7 @@ public class CliContext {
@JsonProperty("fhirpath")
private String fhirpath = null;
@JsonProperty("snomedCT")
private String snomedCT = SnomedVersion.INTL.getCode();
private String snomedCT = "900000000000207008";
@JsonProperty("targetVer")
private String targetVer = null;
@ -339,12 +338,18 @@ public class CliContext {
return this;
}
public SnomedVersion getSnomedCT() {
return SnomedVersion.getFromCode(snomedCT);
}
@JsonProperty("snomedCT")
public String getSnomedCTCode() {
if ("intl".equals(snomedCT)) return "900000000000207008";
if ("us".equals(snomedCT)) return "731000124108";
if ("uk".equals(snomedCT)) return "999000041000000102";
if ("au".equals(snomedCT)) return "32506021000036107";
if ("ca".equals(snomedCT)) return "20611000087101";
if ("nl".equals(snomedCT)) return "11000146104";
if ("se".equals(snomedCT)) return "45991000052106";
if ("es".equals(snomedCT)) return "449081005";
if ("dk".equals(snomedCT)) return "554471000005108";
return snomedCT;
}

View File

@ -1,48 +0,0 @@
package org.hl7.fhir.validation.cli.utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public enum SnomedVersion {
INTL("intl", "900000000000207008"),
US("us", "731000124108"),
UK("uk", "999000041000000102"),
AU("au", "32506021000036107"),
CA("ca", "20611000087101"),
NL("nl", "11000146104"),
SE("se", "45991000052106"),
ES("es", "449081005"),
DK("dk", "554471000005108");
private static final String DEFAULT_CODE = "900000000000207008";
private final String lang;
private final String code;
SnomedVersion(String lang, String code) {
this.lang = lang;
this.code = code;
}
public String getLang() {
return lang;
}
public String getCode() {
return code;
}
public static SnomedVersion getFromCode(String code) {
return lookup.get(code);
}
private static final Map<String, SnomedVersion> lookup = new HashMap<>();
static {
for (SnomedVersion s : SnomedVersion.values()) {
lookup.put(s.getCode(), s);
}
}
}