Merge pull request #974 from hapifhir/gg-202210-parameters

Gg 202210 parameters
This commit is contained in:
Grahame Grieve 2022-11-02 09:39:30 +11:00 committed by GitHub
commit a3be65bcf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 153 additions and 57 deletions

View File

@ -60,52 +60,52 @@ public class ExpansionProfile30_40 {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.ExpansionProfile tgt = new org.hl7.fhir.dstu3.model.ExpansionProfile();
if (src.hasParameter("profile-url"))
tgt.setUrl(src.getParameter("profile-url").primitiveValue());
if (src.hasParameter("profile-version"))
tgt.setVersion(src.getParameter("profile-version").primitiveValue());
if (src.hasParameter("profile-name"))
tgt.setName(src.getParameter("profile-name").primitiveValue());
if (src.hasParameter("profile-status"))
tgt.setStatus(PublicationStatus.fromCode(src.getParameter("profile-status").primitiveValue()));
for (Type t : src.getParameters("system-version")) {
if (src.hasParameterValue("profile-url"))
tgt.setUrl(src.getParameterValue("profile-url").primitiveValue());
if (src.hasParameterValue("profile-version"))
tgt.setVersion(src.getParameterValue("profile-version").primitiveValue());
if (src.hasParameterValue("profile-name"))
tgt.setName(src.getParameterValue("profile-name").primitiveValue());
if (src.hasParameterValue("profile-status"))
tgt.setStatus(PublicationStatus.fromCode(src.getParameterValue("profile-status").primitiveValue()));
for (Type t : src.getParameterValues("system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.DEFAULT);
}
for (Type t : src.getParameters("force-system-version")) {
for (Type t : src.getParameterValues("force-system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.OVERRIDE);
}
for (Type t : src.getParameters("check-system-version")) {
for (Type t : src.getParameterValues("check-system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.CHECK);
}
for (Type t : src.getParameters("exclude-system")) {
for (Type t : src.getParameterValues("exclude-system")) {
String[] v = t.primitiveValue().split("\\|");
tgt.getExcludedSystem().setSystem(v[0]).setVersion(v[1]);
}
if (src.hasParameter("includeDesignations"))
if (src.hasParameterValue("includeDesignations"))
tgt.setIncludeDesignations(src.getParameterBool(""));
for (Type t : src.getParameters("designation")) {
for (Type t : src.getParameterValues("designation")) {
String[] v = t.primitiveValue().split("\\|");
if ("urn:ietf:bcp:47".equals(v[0]))
tgt.getDesignation().getInclude().addDesignation().setLanguage(v[1]);
else
tgt.getDesignation().getInclude().addDesignation().getUse().setSystem(v[0]).setCode(v[1]);
}
if (src.hasParameter("includeDefinition"))
if (src.hasParameterValue("includeDefinition"))
tgt.setIncludeDefinition(src.getParameterBool("includeDefinition"));
if (src.hasParameter("activeOnly"))
if (src.hasParameterValue("activeOnly"))
tgt.setActiveOnly(src.getParameterBool("activeOnly"));
if (src.hasParameter("excludeNested"))
if (src.hasParameterValue("excludeNested"))
tgt.setExcludeNested(src.getParameterBool("excludeNested"));
if (src.hasParameter("excludeNotForUI"))
if (src.hasParameterValue("excludeNotForUI"))
tgt.setExcludeNotForUI(src.getParameterBool("excludeNotForUI"));
if (src.hasParameter("excludeNotForUI"))
if (src.hasParameterValue("excludeNotForUI"))
tgt.setExcludePostCoordinated(src.getParameterBool("excludeNotForUI"));
if (src.hasParameter("displayLanguage"))
tgt.setDisplayLanguage(src.getParameter("displayLanguage").primitiveValue());
if (src.hasParameter("limitedExpansion"))
if (src.hasParameterValue("displayLanguage"))
tgt.setDisplayLanguage(src.getParameterValue("displayLanguage").primitiveValue());
if (src.hasParameterValue("limitedExpansion"))
tgt.setLimitedExpansion(src.getParameterBool("getParameterBool"));
return tgt;
}

View File

@ -214,7 +214,7 @@ public class Resource30_40 {
public org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r4.model.Resource src, BaseAdvisor_30_40 advisor) throws FHIRException {
if (src == null) return null;
if (src instanceof org.hl7.fhir.r4.model.Parameters) {
if (((org.hl7.fhir.r4.model.Parameters) src).hasParameter("profile-url"))
if (((org.hl7.fhir.r4.model.Parameters) src).hasParameterValue("profile-url"))
return ExpansionProfile30_40.convertExpansionProfile((org.hl7.fhir.r4.model.Parameters) src);
else return Parameters30_40.convertParameters((org.hl7.fhir.r4.model.Parameters) src);
}

View File

@ -285,7 +285,7 @@ public class Resource30_50 {
public org.hl7.fhir.dstu3.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
if (src == null) return null;
if (src instanceof org.hl7.fhir.r5.model.Parameters) {
if (((org.hl7.fhir.r5.model.Parameters) src).hasParameter("profile-url"))
if (((org.hl7.fhir.r5.model.Parameters) src).hasParameterValue("profile-url"))
return ExpansionProfile30_50.convertExpansionProfile((org.hl7.fhir.r5.model.Parameters) src);
else return Parameters30_50.convertParameters((org.hl7.fhir.r5.model.Parameters) src);
}

View File

@ -12,52 +12,52 @@ public class ExpansionProfile30_50 {
if (src == null)
return null;
org.hl7.fhir.dstu3.model.ExpansionProfile tgt = new org.hl7.fhir.dstu3.model.ExpansionProfile();
if (src.hasParameter("profile-url"))
tgt.setUrl(src.getParameter("profile-url").primitiveValue());
if (src.hasParameter("profile-version"))
tgt.setVersion(src.getParameter("profile-version").primitiveValue());
if (src.hasParameter("profile-name"))
tgt.setName(src.getParameter("profile-name").primitiveValue());
if (src.hasParameter("profile-status"))
tgt.setStatus(PublicationStatus.fromCode(src.getParameter("profile-status").primitiveValue()));
for (DataType t : src.getParameters("system-version")) {
if (src.hasParameterValue("profile-url"))
tgt.setUrl(src.getParameterValue("profile-url").primitiveValue());
if (src.hasParameterValue("profile-version"))
tgt.setVersion(src.getParameterValue("profile-version").primitiveValue());
if (src.hasParameterValue("profile-name"))
tgt.setName(src.getParameterValue("profile-name").primitiveValue());
if (src.hasParameterValue("profile-status"))
tgt.setStatus(PublicationStatus.fromCode(src.getParameterValue("profile-status").primitiveValue()));
for (DataType t : src.getParameterValues("system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.DEFAULT);
}
for (DataType t : src.getParameters("force-system-version")) {
for (DataType t : src.getParameterValues("force-system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.OVERRIDE);
}
for (DataType t : src.getParameters("check-system-version")) {
for (DataType t : src.getParameterValues("check-system-version")) {
String[] v = t.primitiveValue().split("\\|");
tgt.addFixedVersion().setSystem(v[0]).setVersion(v[1]).setMode(SystemVersionProcessingMode.CHECK);
}
for (DataType t : src.getParameters("exclude-system")) {
for (DataType t : src.getParameterValues("exclude-system")) {
String[] v = t.primitiveValue().split("\\|");
tgt.getExcludedSystem().setSystem(v[0]).setVersion(v[1]);
}
if (src.hasParameter("includeDesignations"))
if (src.hasParameterValue("includeDesignations"))
tgt.setIncludeDesignations(src.getParameterBool(""));
for (DataType t : src.getParameters("designation")) {
for (DataType t : src.getParameterValues("designation")) {
String[] v = t.primitiveValue().split("\\|");
if ("urn:ietf:bcp:47".equals(v[0]))
tgt.getDesignation().getInclude().addDesignation().setLanguage(v[1]);
else
tgt.getDesignation().getInclude().addDesignation().getUse().setSystem(v[0]).setCode(v[1]);
}
if (src.hasParameter("includeDefinition"))
if (src.hasParameterValue("includeDefinition"))
tgt.setIncludeDefinition(src.getParameterBool("includeDefinition"));
if (src.hasParameter("activeOnly"))
if (src.hasParameterValue("activeOnly"))
tgt.setActiveOnly(src.getParameterBool("activeOnly"));
if (src.hasParameter("excludeNested"))
if (src.hasParameterValue("excludeNested"))
tgt.setExcludeNested(src.getParameterBool("excludeNested"));
if (src.hasParameter("excludeNotForUI"))
if (src.hasParameterValue("excludeNotForUI"))
tgt.setExcludeNotForUI(src.getParameterBool("excludeNotForUI"));
if (src.hasParameter("excludeNotForUI"))
if (src.hasParameterValue("excludeNotForUI"))
tgt.setExcludePostCoordinated(src.getParameterBool("excludeNotForUI"));
if (src.hasParameter("displayLanguage"))
tgt.setDisplayLanguage(src.getParameter("displayLanguage").primitiveValue());
if (src.hasParameter("limitedExpansion"))
if (src.hasParameterValue("displayLanguage"))
tgt.setDisplayLanguage(src.getParameterValue("displayLanguage").primitiveValue());
if (src.hasParameterValue("limitedExpansion"))
tgt.setLimitedExpansion(src.getParameterBool("getParameterBool"));
return tgt;
}

View File

@ -877,6 +877,14 @@ public class Parameters extends Resource implements IBaseParameters {
return this;
}
public boolean hasParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name) && p.hasValue())
return true;
}
return false;
}
public boolean hasParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -885,7 +893,7 @@ public class Parameters extends Resource implements IBaseParameters {
return false;
}
public Type getParameter(String name) {
public Type getParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p.getValue();
@ -893,7 +901,15 @@ public class Parameters extends Resource implements IBaseParameters {
return null;
}
public List<Type> getParameters(String name) {
public ParametersParameterComponent getParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p;
}
return null;
}
public List<Type> getParameterValues(String name) {
List<Type> res = new ArrayList<Type>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -902,7 +918,15 @@ public class Parameters extends Resource implements IBaseParameters {
return res;
}
public List<ParametersParameterComponent> getParameters(String name) {
List<ParametersParameterComponent> res = new ArrayList<ParametersParameterComponent>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
res.add(p);
}
return res;
}
public boolean getParameterBool(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name)) {

View File

@ -1667,6 +1667,14 @@ public Parameters addParameter(String name, boolean b) {
return this;
}
public boolean hasParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name) && p.hasValue())
return true;
}
return false;
}
public boolean hasParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -1675,7 +1683,7 @@ public Parameters addParameter(String name, boolean b) {
return false;
}
public DataType getParameter(String name) {
public DataType getParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p.getValue();
@ -1683,7 +1691,15 @@ public Parameters addParameter(String name, boolean b) {
return null;
}
public List<DataType> getParameters(String name) {
public ParametersParameterComponent getParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p;
}
return null;
}
public List<DataType> getParameterValues(String name) {
List<DataType> res = new ArrayList<>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -1692,6 +1708,15 @@ public Parameters addParameter(String name, boolean b) {
return res;
}
public List<ParametersParameterComponent> getParameters(String name) {
List<ParametersParameterComponent> res = new ArrayList<>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
res.add(p);
}
return res;
}
public boolean getParameterBool(String name) {
for (ParametersParameterComponent p : getParameter()) {

View File

@ -39,6 +39,7 @@ import org.hl7.fhir.r5.model.Enumerations.*;
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.ICompositeType;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
import org.hl7.fhir.instance.model.api.IBaseBackboneElement;
@ -1747,6 +1748,14 @@ public Parameters addParameter(String name, boolean b) {
return this;
}
public boolean hasParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name) && p.hasValue())
return true;
}
return false;
}
public boolean hasParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -1755,7 +1764,7 @@ public Parameters addParameter(String name, boolean b) {
return false;
}
public DataType getParameter(String name) {
public DataType getParameterValue(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p.getValue();
@ -1763,7 +1772,15 @@ public Parameters addParameter(String name, boolean b) {
return null;
}
public List<DataType> getParameters(String name) {
public ParametersParameterComponent getParameter(String name) {
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
return p;
}
return null;
}
public List<DataType> getParameterValues(String name) {
List<DataType> res = new ArrayList<>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
@ -1771,7 +1788,15 @@ public Parameters addParameter(String name, boolean b) {
}
return res;
}
public List<ParametersParameterComponent> getParameters(String name) {
List<ParametersParameterComponent> res = new ArrayList<ParametersParameterComponent>();
for (ParametersParameterComponent p : getParameter()) {
if (p.getName().equals(name))
res.add(p);
}
return res;
}
public boolean getParameterBool(String name) {
for (ParametersParameterComponent p : getParameter()) {

View File

@ -1004,7 +1004,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
PropertyWrapper pe = map.get(p.getName()+"["+url+"]");
if (pe == null) {
if (ed == null) {
if (url.startsWith("http://hl7.org/fhir") && !url.startsWith("http://hl7.org/fhir/us")) {
if (url != null && url.startsWith("http://hl7.org/fhir") && !url.startsWith("http://hl7.org/fhir/us")) {
throw new DefinitionException("unknown extension "+url);
}
// System.out.println("unknown extension "+url);

View File

@ -98,7 +98,7 @@ public class Resolver {
if (resource instanceof Bundle) {
Bundle b = (Bundle) resource;
for (BundleEntryComponent be : b.getEntry()) {
if (be.getFullUrl().equals(value))
if (be.hasFullUrl() && be.getFullUrl().equals(value))
return be;
if (value.equals(be.getResource().fhirType()+"/"+be.getResource().getId()))
return be;

View File

@ -6,6 +6,6 @@ public class CommonPackages {
public static final String VER_XVER = "0.0.11";
public static final String ID_PUBPACK = "hl7.fhir.pubpack";
public static final String VER_PUBPACK = "0.1.2";
public static final String VER_PUBPACK = "0.1.3";
}

View File

@ -2162,3 +2162,14 @@ v: {
"system" : "http://loinc.org"
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://loinc.org",
"code" : "57024-2",
"display" : "Health Quality Measure Document"
}, "valueSet" :null, "lang":"null", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "versionFlexible":"false"}####
v: {
"display" : "Health Quality Measure document",
"code" : "57024-2",
"system" : "http://loinc.org"
}
-------------------------------------------------------------------------------------

View File

@ -2056,3 +2056,14 @@ v: {
"system" : "http://snomed.info/sct"
}
-------------------------------------------------------------------------------------
{"code" : {
"system" : "http://snomed.info/sct",
"code" : "116288000",
"display" : "Paralytic stroke (disorder)"
}, "valueSet" :null, "lang":"null", "useServer":"true", "useClient":"true", "guessSystem":"false", "valueSetMode":"ALL_CHECKS", "versionFlexible":"false"}####
v: {
"display" : "Paralytic stroke",
"code" : "116288000",
"system" : "http://snomed.info/sct"
}
-------------------------------------------------------------------------------------