Merge pull request #153 from hapifhir/i18n

I18n
This commit is contained in:
Grahame Grieve 2020-03-12 10:46:31 +11:00 committed by GitHub
commit dfa0a6b021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 1764 additions and 897 deletions

View File

@ -4,6 +4,7 @@ import org.hl7.fhir.convertors.VersionConvertor_10_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.Dosage;
import org.hl7.fhir.r5.model.Dosage.DosageDoseAndRateComponent;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory;
public class MedicationDispense10_50 {
@ -127,7 +128,7 @@ public class MedicationDispense10_50 {
public static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> convertMedicationDispenseStatus(org.hl7.fhir.dstu2.model.Enumeration<org.hl7.fhir.dstu2.model.MedicationDispense.MedicationDispenseStatus> src) throws FHIRException {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory());
VersionConvertor_10_50.copyElement(src, tgt);
switch(src.getValue()) {
case COMPLETED:

View File

@ -3,6 +3,7 @@ package org.hl7.fhir.convertors.conv30_50;
import org.hl7.fhir.convertors.VersionConvertor_30_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory;
public class MedicationAdministration30_50 {
@ -139,7 +140,7 @@ public class MedicationAdministration30_50 {
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> convertMedicationAdministrationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.MedicationAdministration.MedicationAdministrationStatus> src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationAdministrationStatusCodesEnumFactory());
VersionConvertor_30_50.copyElement(src, tgt);
tgt.setValue(org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes.fromCode(src.getValueAsString()));
return tgt;

View File

@ -25,6 +25,7 @@ import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.CodeableReference;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodes;
import org.hl7.fhir.r5.model.MedicationAdministration.MedicationAdministrationStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -141,7 +142,7 @@ public class MedicationAdministration40_50 extends VersionConvertor_40_50 {
private static Enumeration<MedicationAdministrationStatusCodes> convertMedicationAdministrationStatus(CodeType src) {
if (src == null)
return null;
Enumeration<MedicationAdministrationStatusCodes> tgt = new Enumeration<MedicationAdministrationStatusCodes>();
Enumeration<MedicationAdministrationStatusCodes> tgt = new Enumeration<>(new MedicationAdministrationStatusCodesEnumFactory());
copyElement(src, tgt);
tgt.setValue(MedicationAdministrationStatusCodes.fromCode(src.getCode()));
return tgt;

View File

@ -23,6 +23,7 @@ import org.hl7.fhir.convertors.VersionConvertor_40_50;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes;
import org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -162,7 +163,7 @@ public class MedicationDispense40_50 extends VersionConvertor_40_50 {
private static org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> convertMedicationStatus(org.hl7.fhir.r4.model.CodeType src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationDispense.MedicationDispenseStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationDispenseStatusCodesEnumFactory());
copyElement(src, tgt);
if (src.hasCode())
tgt.setValue(MedicationDispenseStatusCodes.fromCode(src.getCode()));

View File

@ -24,6 +24,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.r4.model.CodeType;
import org.hl7.fhir.r5.model.Enumeration;
import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes;
import org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodesEnumFactory;
/*
Copyright (c) 2011+, HL7, Inc.
@ -148,7 +149,7 @@ public class MedicationKnowledge40_50 extends VersionConvertor_40_50 {
private static Enumeration<MedicationKnowledgeStatusCodes> convertMedicationKnowledgeStatus(CodeType src) {
if (src == null)
return null;
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes>();
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationKnowledge.MedicationKnowledgeStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new MedicationKnowledgeStatusCodesEnumFactory());
copyElement(src, tgt);
tgt.setValue(MedicationKnowledgeStatusCodes.fromCode(src.getCode()));
return tgt;

View File

@ -23,11 +23,15 @@ package org.hl7.fhir.dstu2.utils;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.Set;
import org.hl7.fhir.dstu2.model.BooleanType;
@ -73,6 +77,8 @@ public abstract class BaseWorkerContext implements IWorkerContext {
// private ValueSetExpansionCache expansionCache; //
protected FHIRToolingClient txServer;
private Locale locale;
private ResourceBundle i18Nmessages;
@Override
public ValueSet fetchCodeSystem(String system) {
@ -402,4 +408,37 @@ public abstract class BaseWorkerContext implements IWorkerContext {
return fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+typeName);
}
@Override
public Locale getLocale() {
if (Objects.nonNull(locale)){
return locale;
} else {
return Locale.US;
}
}
@Override
public void setLocale(Locale locale) {
this.locale = locale;
setValidationMessageLanguage(getLocale());
}
@Override
public String formatMessage(String theMessage, Object... theMessageArguments) {
String message = theMessage;
if (Objects.nonNull(i18Nmessages) && i18Nmessages.containsKey(theMessage)) {
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
message = MessageFormat.format(i18Nmessages.getString(theMessage), theMessageArguments);
} else {
message = i18Nmessages.getString(theMessage);
}
}
return message;
}
@Override
public void setValidationMessageLanguage(Locale locale) {
i18Nmessages = ResourceBundle.getBundle("Messages", locale );
}
}

View File

@ -23,6 +23,7 @@ package org.hl7.fhir.dstu2.utils;
import java.util.List;
import java.util.Locale;
import org.hl7.fhir.dstu2.formats.IParser;
import org.hl7.fhir.dstu2.formats.ParserType;
import org.hl7.fhir.dstu2.model.CodeableConcept;
@ -208,7 +209,15 @@ public interface IWorkerContext {
* @return
*/
public ValueSetExpansionComponent expandVS(ConceptSetComponent inc);
Locale getLocale();
void setLocale(Locale locale);
String formatMessage(String theMessage, Object... theMessageArguments);
void setValidationMessageLanguage(Locale locale);
public class ValidationResult {
private ConceptDefinitionComponent definition;
private IssueSeverity severity;

View File

@ -23,11 +23,15 @@ package org.hl7.fhir.dstu2016may.utils;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.Set;
import org.hl7.fhir.dstu2016may.model.BooleanType;
@ -75,6 +79,8 @@ public abstract class BaseWorkerContext implements IWorkerContext {
protected FHIRToolingClient txServer;
private Bundle bndCodeSystems;
private Locale locale;
private ResourceBundle i18Nmessages;
@Override
public CodeSystem fetchCodeSystem(String system) {
@ -441,5 +447,37 @@ public abstract class BaseWorkerContext implements IWorkerContext {
return fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+typeName);
}
@Override
public Locale getLocale() {
if (Objects.nonNull(locale)){
return locale;
} else {
return Locale.US;
}
}
@Override
public void setLocale(Locale locale) {
this.locale = locale;
setValidationMessageLanguage(getLocale());
}
@Override
public String formatMessage(String theMessage, Object... theMessageArguments) {
String message = theMessage;
if (Objects.nonNull(i18Nmessages) && i18Nmessages.containsKey(theMessage)) {
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
message = MessageFormat.format(i18Nmessages.getString(theMessage), theMessageArguments);
} else {
message = i18Nmessages.getString(theMessage);
}
}
return message;
}
@Override
public void setValidationMessageLanguage(Locale locale) {
i18Nmessages = ResourceBundle.getBundle("Messages", locale );
}
}

View File

@ -22,6 +22,7 @@ package org.hl7.fhir.dstu2016may.utils;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import org.hl7.fhir.dstu2016may.formats.IParser;
@ -204,7 +205,15 @@ public interface IWorkerContext {
* @return
*/
public ValueSetExpansionComponent expandVS(ConceptSetComponent inc);
Locale getLocale();
void setLocale(Locale locale);
String formatMessage(String theMessage, Object... theMessageArguments);
void setValidationMessageLanguage(Locale locale);
public class ValidationResult {
private ConceptDefinitionComponent definition;
private IssueSeverity severity;

View File

@ -22,6 +22,7 @@ package org.hl7.fhir.dstu3.context;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import org.hl7.fhir.dstu3.formats.IParser;
@ -236,7 +237,15 @@ public interface IWorkerContext {
* @throws FHIRException
*/
public ValueSetExpansionComponent expandVS(ConceptSetComponent inc, boolean heiarchical) throws TerminologyServiceException;
Locale getLocale();
void setLocale(Locale locale);
String formatMessage(String theMessage, Object... theMessageArguments);
void setValidationMessageLanguage(Locale locale);
public class ValidationResult {
private ConceptDefinitionComponent definition;
private IssueSeverity severity;

View File

@ -21,6 +21,10 @@ package org.hl7.fhir.r4.context;
*/
import com.google.gson.JsonObject;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.Objects;
import java.util.ResourceBundle;
import org.apache.commons.lang3.StringUtils;
import org.fhir.ucum.UcumService;
import org.hl7.fhir.exceptions.DefinitionException;
@ -99,7 +103,9 @@ public abstract class BaseWorkerContext implements IWorkerContext {
protected TerminologyCache txCache;
private boolean tlogging = true;
private Locale locale;
private ResourceBundle i18Nmessages;
public BaseWorkerContext() throws FileNotFoundException, IOException, FHIRException {
super();
txCache = new TerminologyCache(lock, null);
@ -1174,5 +1180,37 @@ public abstract class BaseWorkerContext implements IWorkerContext {
return null;
}
@Override
public Locale getLocale() {
if (Objects.nonNull(locale)){
return locale;
} else {
return Locale.US;
}
}
@Override
public void setLocale(Locale locale) {
this.locale = locale;
setValidationMessageLanguage(getLocale());
}
@Override
public String formatMessage(String theMessage, Object... theMessageArguments) {
String message = theMessage;
if (Objects.nonNull(i18Nmessages) && i18Nmessages.containsKey(theMessage)) {
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
message = MessageFormat.format(i18Nmessages.getString(theMessage), theMessageArguments);
} else {
message = i18Nmessages.getString(theMessage);
}
}
return message;
}
@Override
public void setValidationMessageLanguage(Locale locale) {
i18Nmessages = ResourceBundle.getBundle("Messages", locale );
}
}

View File

@ -22,6 +22,7 @@ package org.hl7.fhir.r4.context;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -283,7 +284,15 @@ public interface IWorkerContext {
* @throws FHIRException
*/
public ValueSetExpansionOutcome expandVS(ConceptSetComponent inc, boolean heirarchical) throws TerminologyServiceException;
Locale getLocale();
void setLocale(Locale locale);
String formatMessage(String theMessage, Object... theMessageArguments);
void setValidationMessageLanguage(Locale locale);
public class ValidationResult {
private ConceptDefinitionComponent definition;
private IssueSeverity severity;

View File

@ -9,9 +9,9 @@ package org.hl7.fhir.r5.conformance;
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -31,13 +31,13 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.FHIRFormatError;
import org.hl7.fhir.r5.conformance.ProfileUtilities.BaseTypeSlice;
import org.hl7.fhir.r5.conformance.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution;
import org.hl7.fhir.r5.context.IWorkerContext;
import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult;
@ -95,7 +95,7 @@ import org.hl7.fhir.r5.utils.TranslatingUtilities;
import org.hl7.fhir.r5.utils.formats.CSVWriter;
import org.hl7.fhir.r5.utils.formats.XLSXWriter;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.TerminologyServiceOptions;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.VersionUtilities;
import org.hl7.fhir.utilities.validation.ValidationOptions;
@ -266,6 +266,7 @@ public class ProfileUtilities extends TranslatingUtilities {
private boolean newSlicingProcessing;
private String defWebRoot;
private boolean autoFixSliceNames;
private ResourceBundle i18nMessages;
public ProfileUtilities(IWorkerContext context, List<ValidationMessage> messages, ProfileKnowledgeProvider pkp) {
super();
@ -273,7 +274,7 @@ public class ProfileUtilities extends TranslatingUtilities {
this.messages = messages;
this.pkp = pkp;
}
private class UnusedTracker {
private boolean used;
}
@ -298,19 +299,20 @@ public class ProfileUtilities extends TranslatingUtilities {
}
public interface ProfileKnowledgeProvider {
public class BindingResolution {
class BindingResolution {
public String display;
public String url;
}
public boolean isDatatype(String typeSimple);
public boolean isResource(String typeSimple);
public boolean hasLinkFor(String typeSimple);
public String getLinkFor(String corePath, String typeSimple);
public BindingResolution resolveBinding(StructureDefinition def, ElementDefinitionBindingComponent binding, String path) throws FHIRException;
public BindingResolution resolveBinding(StructureDefinition def, String url, String path) throws FHIRException;
public String getLinkForProfile(StructureDefinition profile, String url);
public boolean prependLinks();
public String getLinkForUrl(String corePath, String s);
boolean isDatatype(String typeSimple);
boolean isResource(String typeSimple);
boolean hasLinkFor(String typeSimple);
String getLinkFor(String corePath, String typeSimple);
BindingResolution resolveBinding(StructureDefinition def,
ElementDefinitionBindingComponent binding, String path) throws FHIRException;
BindingResolution resolveBinding(StructureDefinition def, String url, String path) throws FHIRException;
String getLinkForProfile(StructureDefinition profile, String url);
boolean prependLinks();
String getLinkForUrl(String corePath, String s);
}
@ -321,7 +323,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (element.getContentReference().equals("#"+e.getId()))
return getChildMap(profile, e);
}
throw new DefinitionException("Unable to resolve name reference "+element.getContentReference()+" at path "+element.getPath());
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_NAME_REFERENCE__AT_PATH_, element.getContentReference(), element.getPath()));
} else {
List<ElementDefinition> res = new ArrayList<ElementDefinition>();
@ -343,7 +345,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public List<ElementDefinition> getSliceList(StructureDefinition profile, ElementDefinition element) throws DefinitionException {
if (!element.hasSlicing())
throw new Error("getSliceList should only be called when the element has slicing");
throw new Error(context.formatMessage(I18nConstants.GETSLICELIST_SHOULD_ONLY_BE_CALLED_WHEN_THE_ELEMENT_HAS_SLICING));
List<ElementDefinition> res = new ArrayList<ElementDefinition>();
List<ElementDefinition> elements = profile.getSnapshot().getElement();
@ -382,9 +384,9 @@ public class ProfileUtilities extends TranslatingUtilities {
List<ElementDefinition> list = diff ? profile.getDifferential().getElement() : profile.getSnapshot().getElement();
for (ElementDefinition e : list) {
if (e == null)
throw new Error("element = null: "+profile.getUrl());
throw new Error(context.formatMessage(I18nConstants.ELEMENT__NULL_, profile.getUrl()));
if (e.getId() == null)
throw new Error("element id = null: "+e.toString()+" on "+profile.getUrl());
throw new Error(context.formatMessage(I18nConstants.ELEMENT_ID__NULL__ON_, e.toString(), profile.getUrl()));
if (!capturing && id!=null && e.getId().equals(id)) {
capturing = true;
@ -425,9 +427,9 @@ public class ProfileUtilities extends TranslatingUtilities {
public void updateMaps(StructureDefinition base, StructureDefinition derived) throws DefinitionException {
if (base == null)
throw new DefinitionException("no base profile provided");
throw new DefinitionException(context.formatMessage(I18nConstants.NO_BASE_PROFILE_PROVIDED));
if (derived == null)
throw new DefinitionException("no derived structure provided");
throw new DefinitionException(context.formatMessage(I18nConstants.NO_DERIVED_STRUCTURE_PROVIDED));
for (StructureDefinitionMappingComponent baseMap : base.getMapping()) {
boolean found = false;
@ -458,30 +460,30 @@ public class ProfileUtilities extends TranslatingUtilities {
*/
public void generateSnapshot(StructureDefinition base, StructureDefinition derived, String url, String webUrl, String profileName) throws DefinitionException, FHIRException {
if (base == null) {
throw new DefinitionException("no base profile provided");
throw new DefinitionException(context.formatMessage(I18nConstants.NO_BASE_PROFILE_PROVIDED));
}
if (derived == null) {
throw new DefinitionException("no derived structure provided");
throw new DefinitionException(context.formatMessage(I18nConstants.NO_DERIVED_STRUCTURE_PROVIDED));
}
checkNotGenerating(base, "Base for generating a snapshot for the profile "+derived.getUrl());
checkNotGenerating(derived, "Focus for generating a snapshot");
derived.setUserData("profileutils.snapshot.generating", true);
if (!base.hasType()) {
throw new DefinitionException("Base profile "+base.getUrl()+" has no type");
throw new DefinitionException(context.formatMessage(I18nConstants.BASE_PROFILE__HAS_NO_TYPE, base.getUrl()));
}
if (!derived.hasType()) {
throw new DefinitionException("Derived profile "+derived.getUrl()+" has no type");
throw new DefinitionException(context.formatMessage(I18nConstants.DERIVED_PROFILE__HAS_NO_TYPE, derived.getUrl()));
}
if (!derived.hasDerivation()) {
throw new DefinitionException("Derived profile "+derived.getUrl()+" has no derivation value and so can't be processed");
throw new DefinitionException(context.formatMessage(I18nConstants.DERIVED_PROFILE__HAS_NO_DERIVATION_VALUE_AND_SO_CANT_BE_PROCESSED, derived.getUrl()));
}
if (!base.getType().equals(derived.getType()) && derived.getDerivation() == TypeDerivationRule.CONSTRAINT) {
throw new DefinitionException("Base & Derived profiles have different types ("+base.getUrl()+" = "+base.getType()+" vs "+derived.getUrl()+" = "+derived.getType()+")");
throw new DefinitionException(context.formatMessage(I18nConstants.BASE__DERIVED_PROFILES_HAVE_DIFFERENT_TYPES____VS___, base.getUrl(), base.getType(), derived.getUrl(), derived.getType()));
}
if (snapshotStack.contains(derived.getUrl())) {
throw new DefinitionException("Circular snapshot references detected; cannot generate snapshot (stack = "+snapshotStack.toString()+")");
throw new DefinitionException(context.formatMessage(I18nConstants.CIRCULAR_SNAPSHOT_REFERENCES_DETECTED_CANNOT_GENERATE_SNAPSHOT_STACK__, snapshotStack.toString()));
}
snapshotStack.add(derived.getUrl());
@ -505,7 +507,7 @@ public class ProfileUtilities extends TranslatingUtilities {
int diffCursor = 0; // we need a diff cursor because we can only look ahead, in the bound scoped by longer paths
if (derived.hasDifferential() && !derived.getDifferential().getElementFirstRep().getPath().contains(".") && !derived.getDifferential().getElementFirstRep().getType().isEmpty())
throw new Error("type on first differential element!");
throw new Error(context.formatMessage(I18nConstants.TYPE_ON_FIRST_DIFFERENTIAL_ELEMENT));
for (ElementDefinition e : derived.getDifferential().getElement())
e.clearUserData(GENERATED_IN_SNAPSHOT);
@ -536,7 +538,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
if (!derived.getSnapshot().getElementFirstRep().getType().isEmpty())
throw new Error("type on first snapshot element for "+derived.getSnapshot().getElementFirstRep().getPath()+" in "+derived.getUrl()+" from "+base.getUrl());
throw new Error(context.formatMessage(I18nConstants.TYPE_ON_FIRST_SNAPSHOT_ELEMENT_FOR__IN__FROM_, derived.getSnapshot().getElementFirstRep().getPath(), derived.getUrl(), base.getUrl()));
updateMaps(base, derived);
if (debug) {
@ -553,7 +555,7 @@ public class ProfileUtilities extends TranslatingUtilities {
int ce = 0;
for (ElementDefinition e : diff.getElement()) {
if (!e.hasUserData("diff-source"))
throw new Error("Unxpected internal condition - no source on diff element");
throw new Error(context.formatMessage(I18nConstants.UNXPECTED_INTERNAL_CONDITION__NO_SOURCE_ON_DIFF_ELEMENT));
else {
if (e.hasUserData(DERIVATION_EQUALS))
((Base) e.getUserData("diff-source")).setUserData(DERIVATION_EQUALS, e.getUserData(DERIVATION_EQUALS));
@ -599,7 +601,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
}
// last, check for wrong profiles or target profiles
// last, check for wrong profiles or target profiles
for (ElementDefinition ed : derived.getSnapshot().getElement()) {
for (TypeRefComponent t : ed.getType()) {
for (UriType u : t.getProfile()) {
@ -639,14 +641,14 @@ public class ProfileUtilities extends TranslatingUtilities {
boolean first = true;
for (ElementDefinition ed : elements) {
if (!ed.hasPath()) {
throw new FHIRException("No path on element in differential in "+url);
throw new FHIRException(context.formatMessage(I18nConstants.NO_PATH_ON_ELEMENT_IN_DIFFERENTIAL_IN_, url));
}
String p = ed.getPath();
if (p == null) {
throw new FHIRException("No path value on element in differential in "+url);
throw new FHIRException(context.formatMessage(I18nConstants.NO_PATH_VALUE_ON_ELEMENT_IN_DIFFERENTIAL_IN_, url));
}
if (!((first && type.equals(p)) || p.startsWith(type+"."))) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": must start with "+type+"."+(first ? " (o be '"+type+"')" : ""));
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__MUST_START_WITH_, p, url, type, (first ? " (o be '"+type+"')" : "")));
}
if (p.contains(".")) {
// Element names (the parts of a path delineated by the '.' character) SHALL NOT contain whitespace (i.e. Unicode characters marked as whitespace)
@ -656,25 +658,25 @@ public class ProfileUtilities extends TranslatingUtilities {
String[] pl = p.split("\\.");
for (String pp : pl) {
if (pp.length() < 1) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": name portion mising ('..')");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NAME_PORTION_MISING_, p, url));
}
if (pp.length() > 64) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": name portion exceeds 64 chars in length");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NAME_PORTION_EXCEEDS_64_CHARS_IN_LENGTH, p, url));
}
for (char ch : pp.toCharArray()) {
if (Character.isWhitespace(ch)) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": no unicode whitespace");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NO_UNICODE_WHITESPACE, p, url));
}
if (Utilities.existsInList(ch, ',', ':', ';', '\'', '"', '/', '|', '?', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '{', '}')) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": illegal character '"+ch+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__ILLEGAL_CHARACTER_, p, url, ch));
}
if (ch < ' ' || ch > 'z') {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": illegal character '"+ch+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__ILLEGAL_CHARACTER_, p, url, ch));
}
}
if (pp.contains("[") || pp.contains("]")) {
if (!pp.endsWith("[x]") || (pp.substring(0, pp.length()-3).contains("[") || (pp.substring(0, pp.length()-3).contains("]")))) {
throw new FHIRException("Illegal path '"+p+"' in differential in "+url+": illegal characters []");
throw new FHIRException(context.formatMessage(I18nConstants.ILLEGAL_PATH__IN_DIFFERENTIAL_IN__ILLEGAL_CHARACTERS_, p, url));
}
}
}
@ -828,7 +830,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (resultPathBase == null)
resultPathBase = outcome.getPath();
else if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path - outcome.getPath() = "+outcome.getPath()+", resultPathBase = "+resultPathBase);
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH__OUTCOMEGETPATH___RESULTPATHBASE__, outcome.getPath(), resultPathBase));
result.getElement().add(outcome);
if (hasInnerDiffMatches(differential, cpath, diffCursor, diffLimit, base.getElement(), true)) {
// well, the profile walks into this, so we need to as well
@ -838,17 +840,17 @@ public class ProfileUtilities extends TranslatingUtilities {
baseCursor = indexOfFirstNonChild(base, currentBase, baseCursor+1, baseLimit);
} else {
if (outcome.getType().size() == 0) {
throw new DefinitionException(diffMatches.get(0).getPath()+" has no children ("+differential.getElement().get(diffCursor).getPath()+") and no types in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), profileName));
}
if (outcome.getType().size() > 1) {
for (TypeRefComponent t : outcome.getType()) {
if (!t.getWorkingCode().equals("Reference"))
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") and multiple types ("+typeCode(outcome.getType())+") in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
}
}
StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));
if (dt == null)
throw new DefinitionException("Unknown type "+outcome.getType().get(0)+" at "+diffMatches.get(0).getPath());
throw new DefinitionException(context.formatMessage(I18nConstants.UNKNOWN_TYPE__AT_, outcome.getType().get(0), diffMatches.get(0).getPath()));
contextName = dt.getUrl();
int start = diffCursor;
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), cpath+"."))
@ -868,7 +870,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (!sd.hasSnapshot()) {
StructureDefinition sdb = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
if (sdb == null)
throw new DefinitionException("Unable to find base "+sd.getBaseDefinition()+" for "+sd.getUrl());
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_BASE__FOR_, sd.getBaseDefinition(), sd.getUrl()));
checkNotGenerating(sdb, "an extension base");
generateSnapshot(sdb, sd, sd.getUrl(), (sdb.hasUserData("path")) ? Utilities.extractBaseUrl(sdb.getUserString("path")) : webUrl, sd.getName());
}
@ -881,7 +883,7 @@ public class ProfileUtilities extends TranslatingUtilities {
src = t;
}
if (src == null)
throw new DefinitionException("Unable to find element "+eid+" in "+p.getValue());
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_ELEMENT__IN_, eid, p.getValue()));
} else
src = sd.getSnapshot().getElement().get(0);
template = src.copy().setPath(currentBase.getPath());
@ -914,7 +916,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (resultPathBase == null)
resultPathBase = outcome.getPath();
else if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
result.getElement().add(outcome);
baseCursor++;
diffCursor = differential.getElement().indexOf(diffMatches.get(0))+1;
@ -941,7 +943,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (ed != diffMatches.get(0) && !ed.getPath().endsWith(".extension"))
nonExtension = true;
if (nonExtension)
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") and multiple types ("+typeCode(outcome.getType())+") in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
}
}
}
@ -951,7 +953,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (outcome.hasContentReference()) {
ElementDefinition tgt = getElementById(base.getElement(), outcome.getContentReference());
if (tgt == null)
throw new DefinitionException("Unable to resolve reference to "+outcome.getContentReference());
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_REFERENCE_TO_, outcome.getContentReference()));
replaceFromContentReference(outcome, tgt);
int nbc = base.getElement().indexOf(tgt)+1;
int nbl = nbc;
@ -961,7 +963,7 @@ public class ProfileUtilities extends TranslatingUtilities {
} else {
StructureDefinition dt = outcome.getType().size() == 1 ? getProfileForDataType(outcome.getType().get(0)) : getProfileForDataType("Element");
if (dt == null)
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") for type "+typeCode(outcome.getType())+" in profile "+profileName+", but can't find type");
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
contextName = dt.getUrl();
processPaths(indent+" ", result, dt.getSnapshot(), differential, 1 /* starting again on the data type, but skip the root */, start, dt.getSnapshot().getElement().size()-1,
diffCursor - 1, url, getWebUrl(dt, webUrl, indent), profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null, new ArrayList<ElementRedirection>(), srcSD);
@ -974,9 +976,9 @@ public class ProfileUtilities extends TranslatingUtilities {
int ndc = differential.getElement().indexOf(diffMatches.get(0));
ElementDefinition elementToRemove = null;
boolean shortCut = !typeList.isEmpty() && typeList.get(0).type != null;
// we come here whether they are sliced in the diff, or whether the short cut is used.
// we come here whether they are sliced in the diff, or whether the short cut is used.
if (shortCut) {
// this is the short cut method, we've just dived in and specified a type slice.
// this is the short cut method, we've just dived in and specified a type slice.
// in R3 (and unpatched R4, as a workaround right now...
if (!FHIRVersion.isR4Plus(context.getVersion()) || !newSlicingProcessing) { // newSlicingProcessing is a work around for editorial loop dependency
// we insert a cloned element with the right types at the start of the diffMatches
@ -992,9 +994,9 @@ public class ProfileUtilities extends TranslatingUtilities {
differential.getElement().add(ndc, ed);
elementToRemove = ed;
} else {
// as of R4, this changed; if there's no slice, there's no constraint on the slice types, only one the type.
// so the element we insert specifies no types (= all types) allowed in the base, not just the listed type.
// see also discussion here: https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Slicing.20a.20non-repeating.20element
// as of R4, this changed; if there's no slice, there's no constraint on the slice types, only one the type.
// so the element we insert specifies no types (= all types) allowed in the base, not just the listed type.
// see also discussion here: https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Slicing.20a.20non-repeating.20element
ElementDefinition ed = new ElementDefinition();
ed.setPath(determineTypeSlicePath(diffMatches.get(0).getPath(), cpath));
ed.setSlicing(new ElementDefinitionSlicingComponent());
@ -1011,18 +1013,18 @@ public class ProfileUtilities extends TranslatingUtilities {
if (diffMatches.get(0).getSlicing().hasOrdered()) {
if (diffMatches.get(0).getSlicing().getOrdered()) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.ordered = true");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGORDERED__TRUE, cpath, url));
}
}
if (diffMatches.get(0).getSlicing().hasDiscriminator()) {
if (diffMatches.get(0).getSlicing().getDiscriminator().size() != 1) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.count() > 1");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORCOUNT__1, cpath, url));
}
if (diffMatches.get(0).getSlicing().getDiscriminatorFirstRep().getType() != DiscriminatorType.TYPE) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.type != 'type'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORTYPE__TYPE, cpath, url));
}
if (!"$this".equals(diffMatches.get(0).getSlicing().getDiscriminatorFirstRep().getPath())) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.path != '$this'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORPATH__THIS, cpath, url));
}
}
// check the slice names too while we're at it...
@ -1035,28 +1037,28 @@ public class ProfileUtilities extends TranslatingUtilities {
if (autoFixSliceNames) {
ts.defn.setSliceName(tn);
} else {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice name must be '"+tn+"' but is '"+ts.defn.getSliceName()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_NAME_MUST_BE__BUT_IS_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.getSliceName()));
}
} if (!ts.defn.hasType()) {
ts.defn.addType().setCode(ts.type);
} else if (ts.defn.getType().size() > 1) {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice for type '"+tn+"' has more than one type '"+ts.defn.typeSummary()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_MORE_THAN_ONE_TYPE_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.typeSummary()));
} else if (!ts.defn.getType().get(0).getCode().equals(ts.type)) {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice for type '"+tn+"' has wrong type '"+ts.defn.typeSummary()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_WRONG_TYPE_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.typeSummary()));
}
}
}
// ok passed the checks.
// ok passed the checks.
// copy the root diff, and then process any children it has
ElementDefinition e = processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, webUrl, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst,
trimDifferential, contextName, resultPathBase, true, null, redirector, srcSD);
if (e==null)
throw new FHIRException("Did not find type root: " + diffMatches.get(0).getPath());
throw new FHIRException(context.formatMessage(I18nConstants.DID_NOT_FIND_TYPE_ROOT_, diffMatches.get(0).getPath()));
// now set up slicing on the e (cause it was wiped by what we called.
e.setSlicing(new ElementDefinitionSlicingComponent());
e.getSlicing().addDiscriminator().setType(DiscriminatorType.TYPE).setPath("$this");
e.getSlicing().setRules(SlicingRules.CLOSED); // type slicing is always closed; the differential might call it open, but that just means it's not constraining the slices it doesn't mention
e.getSlicing().setRules(SlicingRules.CLOSED); // type slicing is always closed; the differential might call it open, but that just means it's not constraining the slices it doesn't mention
e.getSlicing().setOrdered(false);
start++;
@ -1067,7 +1069,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// our processing scope for the differential is the item in the list, and all the items before the next one in the list
if (diffMatches.get(i).getMin() > 0) {
if (diffMatches.size() > i+1) {
throw new FHIRException("Invalid slicing : there is more than one type slice at "+diffMatches.get(i).getPath()+", but one of them ("+diffMatches.get(i).getSliceName()+") has min = 1, so the other slices cannot exist");
throw new FHIRException(context.formatMessage(I18nConstants.INVALID_SLICING__THERE_IS_MORE_THAN_ONE_TYPE_SLICE_AT__BUT_ONE_OF_THEM__HAS_MIN__1_SO_THE_OTHER_SLICES_CANNOT_EXIST, diffMatches.get(i).getPath(), diffMatches.get(i).getSliceName()));
} else {
e.setMin(1);
}
@ -1099,9 +1101,9 @@ public class ProfileUtilities extends TranslatingUtilities {
if (!unbounded(currentBase) && !isSlicedToOneOnly(diffMatches.get(0)))
// you can only slice an element that doesn't repeat if the sum total of your slices is limited to 1
// (but you might do that in order to split up constraints by type)
throw new DefinitionException("Attempt to a slice an element that does not repeat: "+currentBase.getPath()+"/"+currentBase.getPath()+" from "+contextName+" in "+url);
throw new DefinitionException(context.formatMessage(I18nConstants.ATTEMPT_TO_A_SLICE_AN_ELEMENT_THAT_DOES_NOT_REPEAT__FROM__IN_, currentBase.getPath(), currentBase.getPath(), contextName, url));
if (!diffMatches.get(0).hasSlicing() && !isExtension(currentBase)) // well, the diff has set up a slice, but hasn't defined it. this is an error
throw new DefinitionException("Differential does not have a slice: "+currentBase.getPath()+"/ (b:"+baseCursor+" of "+ baseLimit+" / "+ diffCursor +"/ "+diffLimit+") in profile "+url);
throw new DefinitionException(context.formatMessage(I18nConstants.DIFFERENTIAL_DOES_NOT_HAVE_A_SLICE__B_OF_____IN_PROFILE_, currentBase.getPath(), baseCursor, baseLimit, diffCursor, diffLimit, url));
// well, if it passed those preconditions then we slice the dest.
int start = 0;
@ -1113,7 +1115,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ElementDefinition e = processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, webUrl, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst,
trimDifferential, contextName, resultPathBase, true, null, redirector, srcSD);
if (e==null)
throw new FHIRException("Did not find single slice: " + diffMatches.get(0).getPath());
throw new FHIRException(context.formatMessage(I18nConstants.DID_NOT_FIND_SINGLE_SLICE_, diffMatches.get(0).getPath()));
e.setSlicing(diffMatches.get(0).getSlicing());
start++;
} else {
@ -1127,7 +1129,7 @@ public class ProfileUtilities extends TranslatingUtilities {
else
outcome.setSlicing(diffMatches.get(0).getSlicing().copy());
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
result.getElement().add(outcome);
// differential - if the first one in the list has a name, we'll process it. Else we'll treat it as the base definition of the slice.
@ -1135,7 +1137,7 @@ public class ProfileUtilities extends TranslatingUtilities {
updateFromDefinition(outcome, diffMatches.get(0), profileName, trimDifferential, url, srcSD);
removeStatusExtensions(outcome);
if (!outcome.hasContentReference() && !outcome.hasType()) {
throw new DefinitionException("not done yet");
throw new DefinitionException(context.formatMessage(I18nConstants.NOT_DONE_YET));
}
start++;
// result.getElement().remove(result.getElement().size()-1);
@ -1184,7 +1186,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (resultPathBase == null)
resultPathBase = outcome.getPath();
else if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
result.getElement().add(outcome);
// the profile walks into this, so we need to as well
// did we implicitly step into a new type?
@ -1193,17 +1195,17 @@ public class ProfileUtilities extends TranslatingUtilities {
baseCursor = indexOfFirstNonChild(base, currentBase, baseCursor, baseLimit);
} else {
if (outcome.getType().size() == 0) {
throw new DefinitionException(diffMatches.get(0).getPath()+" has no children ("+differential.getElement().get(diffCursor).getPath()+") and no types in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), profileName));
}
if (outcome.getType().size() > 1) {
for (TypeRefComponent t : outcome.getType()) {
if (!t.getWorkingCode().equals("Reference"))
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") and multiple types ("+typeCode(outcome.getType())+") in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
}
}
StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));
if (dt == null)
throw new DefinitionException("Unknown type "+outcome.getType().get(0)+" at "+diffMatches.get(0).getPath());
throw new DefinitionException(context.formatMessage(I18nConstants.UNKNOWN_TYPE__AT_, outcome.getType().get(0), diffMatches.get(0).getPath()));
contextName = dt.getUrl();
int start = diffCursor;
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), cpath+"."))
@ -1219,7 +1221,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ElementDefinition outcome = updateURLs(url, webUrl, base.getElement().get(baseCursor).copy());
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector, contextPathSrc));
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path in profile " + profileName + ": "+outcome.getPath()+" vs " + resultPathBase);
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH_IN_PROFILE___VS_, profileName, outcome.getPath(), resultPathBase));
result.getElement().add(outcome); // so we just copy it in
baseCursor++;
}
@ -1230,9 +1232,9 @@ public class ProfileUtilities extends TranslatingUtilities {
int ndc = differential.getElement().indexOf(diffMatches.get(0));
ElementDefinition elementToRemove = null;
boolean shortCut = (!typeList.isEmpty() && typeList.get(0).type != null) || (diffMatches.get(0).hasSliceName() && !diffMatches.get(0).hasSlicing());
// we come here whether they are sliced in the diff, or whether the short cut is used.
// we come here whether they are sliced in the diff, or whether the short cut is used.
if (shortCut) {
// this is the short cut method, we've just dived in and specified a type slice.
// this is the short cut method, we've just dived in and specified a type slice.
// in R3 (and unpatched R4, as a workaround right now...
if (!FHIRVersion.isR4Plus(context.getVersion()) || !newSlicingProcessing) { // newSlicingProcessing is a work around for editorial loop dependency
// we insert a cloned element with the right types at the start of the diffMatches
@ -1248,9 +1250,9 @@ public class ProfileUtilities extends TranslatingUtilities {
differential.getElement().add(ndc, ed);
elementToRemove = ed;
} else {
// as of R4, this changed; if there's no slice, there's no constraint on the slice types, only one the type.
// so the element we insert specifies no types (= all types) allowed in the base, not just the listed type.
// see also discussion here: https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Slicing.20a.20non-repeating.20element
// as of R4, this changed; if there's no slice, there's no constraint on the slice types, only one the type.
// so the element we insert specifies no types (= all types) allowed in the base, not just the listed type.
// see also discussion here: https://chat.fhir.org/#narrow/stream/179177-conformance/topic/Slicing.20a.20non-repeating.20element
ElementDefinition ed = new ElementDefinition();
ed.setPath(determineTypeSlicePath(diffMatches.get(0).getPath(), cpath));
ed.setSlicing(new ElementDefinitionSlicingComponent());
@ -1267,18 +1269,18 @@ public class ProfileUtilities extends TranslatingUtilities {
if (diffMatches.get(0).getSlicing().hasOrdered()) {
if (diffMatches.get(0).getSlicing().getOrdered()) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.ordered = true");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGORDERED__TRUE, cpath, url));
}
}
if (diffMatches.get(0).getSlicing().hasDiscriminator()) {
if (diffMatches.get(0).getSlicing().getDiscriminator().size() != 1) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.count() > 1");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORCOUNT__1, cpath, url));
}
if (diffMatches.get(0).getSlicing().getDiscriminatorFirstRep().getType() != DiscriminatorType.TYPE) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.type != 'type'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORTYPE__TYPE, cpath, url));
}
if (!"$this".equals(diffMatches.get(0).getSlicing().getDiscriminatorFirstRep().getPath())) {
throw new FHIRException("Error at path "+cpath+" in "+url+": Type slicing with slicing.discriminator.path != '$this'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORPATH__THIS, cpath, url));
}
}
// check the slice names too while we're at it...
@ -1288,27 +1290,27 @@ public class ProfileUtilities extends TranslatingUtilities {
if (!ts.defn.hasSliceName()) {
ts.defn.setSliceName(tn);
} else if (!ts.defn.getSliceName().equals(tn)) {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice name must be '"+tn+"' but is '"+ts.defn.getSliceName()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_NAME_MUST_BE__BUT_IS_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.getSliceName()));
} if (!ts.defn.hasType()) {
ts.defn.addType().setCode(ts.type);
} else if (ts.defn.getType().size() > 1) {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice for type '"+tn+"' has more than one type '"+ts.defn.typeSummary()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_MORE_THAN_ONE_TYPE_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.typeSummary()));
} else if (!ts.defn.getType().get(0).getCode().equals(ts.type)) {
throw new FHIRException("Error at path "+(!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath)+": Slice for type '"+tn+"' has wrong type '"+ts.defn.typeSummary()+"'");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_WRONG_TYPE_, (!Utilities.noString(contextPathSrc) ? contextPathSrc : cpath), tn, ts.defn.typeSummary()));
}
}
}
// ok passed the checks.
// ok passed the checks.
// copy the root diff, and then process any children it has
ElementDefinition e = processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, webUrl, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst,
trimDifferential, contextName, resultPathBase, true, cpath, redirector, srcSD);
if (e==null)
throw new FHIRException("Did not find type root: " + diffMatches.get(0).getPath());
throw new FHIRException(context.formatMessage(I18nConstants.DID_NOT_FIND_TYPE_ROOT_, diffMatches.get(0).getPath()));
// now set up slicing on the e (cause it was wiped by what we called.
e.setSlicing(new ElementDefinitionSlicingComponent());
e.getSlicing().addDiscriminator().setType(DiscriminatorType.TYPE).setPath("$this");
e.getSlicing().setRules(SlicingRules.CLOSED); // type slicing is always closed; the differential might call it open, but that just means it's not constraining the slices it doesn't mention
e.getSlicing().setRules(SlicingRules.CLOSED); // type slicing is always closed; the differential might call it open, but that just means it's not constraining the slices it doesn't mention
e.getSlicing().setOrdered(false);
start++;
@ -1321,7 +1323,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// our processing scope for the differential is the item in the list, and all the items before the next one in the list
if (diffMatches.get(i).getMin() > 0) {
if (diffMatches.size() > i+1) {
throw new FHIRException("Invalid slicing : there is more than one type slice at "+diffMatches.get(i).getPath()+", but one of them ("+diffMatches.get(i).getSliceName()+") has min = 1, so the other slices cannot exist");
throw new FHIRException(context.formatMessage(I18nConstants.INVALID_SLICING__THERE_IS_MORE_THAN_ONE_TYPE_SLICE_AT__BUT_ONE_OF_THEM__HAS_MIN__1_SO_THE_OTHER_SLICES_CANNOT_EXIST, diffMatches.get(i).getPath(), diffMatches.get(i).getSliceName()));
}
fixedType = type;
}
@ -1373,11 +1375,11 @@ public class ProfileUtilities extends TranslatingUtilities {
ElementDefinitionSlicingComponent dSlice = diffMatches.get(0).getSlicing();
ElementDefinitionSlicingComponent bSlice = currentBase.getSlicing();
if (dSlice.hasOrderedElement() && bSlice.hasOrderedElement() && !orderMatches(dSlice.getOrderedElement(), bSlice.getOrderedElement()))
throw new DefinitionException("Slicing rules on differential ("+summarizeSlicing(dSlice)+") do not match those on base ("+summarizeSlicing(bSlice)+") - order @ "+path+" ("+contextName+")");
throw new DefinitionException(context.formatMessage(I18nConstants.SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___ORDER___, summarizeSlicing(dSlice), summarizeSlicing(bSlice), path, contextName));
if (!discriminatorMatches(dSlice.getDiscriminator(), bSlice.getDiscriminator()))
throw new DefinitionException("Slicing rules on differential ("+summarizeSlicing(dSlice)+") do not match those on base ("+summarizeSlicing(bSlice)+") - disciminator @ "+path+" ("+contextName+")");
throw new DefinitionException(context.formatMessage(I18nConstants.SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___DISCIMINATOR___, summarizeSlicing(dSlice), summarizeSlicing(bSlice), path, contextName));
if (!currentBase.isChoice() && !ruleMatches(dSlice.getRules(), bSlice.getRules()))
throw new DefinitionException("Slicing rules on differential ("+summarizeSlicing(dSlice)+") do not match those on base ("+summarizeSlicing(bSlice)+") - rule @ "+path+" ("+contextName+")");
throw new DefinitionException(context.formatMessage(I18nConstants.SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___RULE___, summarizeSlicing(dSlice), summarizeSlicing(bSlice), path, contextName));
}
ElementDefinition outcome = updateURLs(url, webUrl, currentBase.copy());
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector, contextPathSrc));
@ -1387,7 +1389,7 @@ public class ProfileUtilities extends TranslatingUtilities {
updateFromDefinition(outcome, diffMatches.get(0), profileName, closed, url, srcSD); // if there's no slice, we don't want to update the unsliced description
removeStatusExtensions(outcome);
} else if (!diffMatches.get(0).hasSliceName())
diffMatches.get(0).setUserData(GENERATED_IN_SNAPSHOT, outcome); // because of updateFromDefinition isn't called
diffMatches.get(0).setUserData(GENERATED_IN_SNAPSHOT, outcome); // because of updateFromDefinition isn't called
result.getElement().add(outcome);
@ -1401,11 +1403,11 @@ public class ProfileUtilities extends TranslatingUtilities {
int ndl = findEndOfElement(differential, ndx);
if (nbl == baseCursor) {
if (base.getElement().get(baseCursor).getType().size() != 1) {
throw new Error("Differential walks into '"+cpath+" (@ "+diffMatches.get(0).toString()+")', but the base does not, and there is not a single fixed type. The type is "+base.getElement().get(baseCursor).typeSummary()+". This is not handled yet");
throw new Error(context.formatMessage(I18nConstants.DIFFERENTIAL_WALKS_INTO____BUT_THE_BASE_DOES_NOT_AND_THERE_IS_NOT_A_SINGLE_FIXED_TYPE_THE_TYPE_IS__THIS_IS_NOT_HANDLED_YET, cpath, diffMatches.get(0).toString(), base.getElement().get(baseCursor).typeSummary()));
}
StructureDefinition dt = getProfileForDataType(base.getElement().get(baseCursor).getType().get(0));
if (dt == null) {
throw new DefinitionException("Unknown type "+outcome.getType().get(0)+" at "+diffMatches.get(0).getPath());
throw new DefinitionException(context.formatMessage(I18nConstants.UNKNOWN_TYPE__AT_, outcome.getType().get(0), diffMatches.get(0).getPath()));
}
contextName = dt.getUrl();
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), cpath+"."))
@ -1436,7 +1438,7 @@ public class ProfileUtilities extends TranslatingUtilities {
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector, contextPathSrc));
outcome.setSlicing(null);
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
if (diffpos < diffMatches.size() && diffMatches.get(diffpos).hasSliceName() && diffMatches.get(diffpos).getSliceName().equals(outcome.getSliceName())) {
// if there's a diff, we update the outcome with diff
// no? updateFromDefinition(outcome, diffMatches.get(diffpos), profileName, closed, url);
@ -1458,7 +1460,7 @@ public class ProfileUtilities extends TranslatingUtilities {
outcome = updateURLs(url, webUrl, base.getElement().get(baseCursor).copy());
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector, contextPathSrc));
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
result.getElement().add(outcome);
baseCursor++;
}
@ -1469,11 +1471,11 @@ public class ProfileUtilities extends TranslatingUtilities {
// finally, we process any remaining entries in diff, which are new (and which are only allowed if the base wasn't closed
boolean checkImplicitTypes = false;
if (closed && diffpos < diffMatches.size()) {
// this is a problem, unless we're on a polymorhpic type and we're going to constrain a slice that actually implicitly exists
// this is a problem, unless we're on a polymorhpic type and we're going to constrain a slice that actually implicitly exists
if (currentBase.getPath().endsWith("[x]")) {
checkImplicitTypes = true;
} else {
throw new DefinitionException("The base snapshot marks a slicing as closed, but the differential tries to extend it in "+profileName+" at "+path+" ("+cpath+")");
throw new DefinitionException(context.formatMessage(I18nConstants.THE_BASE_SNAPSHOT_MARKS_A_SLICING_AS_CLOSED_BUT_THE_DIFFERENTIAL_TRIES_TO_EXTEND_IT_IN__AT__, profileName, path, cpath));
}
}
if (diffpos == diffMatches.size()) {
@ -1484,14 +1486,14 @@ public class ProfileUtilities extends TranslatingUtilities {
ElementDefinition diffItem = diffMatches.get(diffpos);
for (ElementDefinition baseItem : baseMatches)
if (baseItem.getSliceName().equals(diffItem.getSliceName()))
throw new DefinitionException("Named items are out of order in the slice");
throw new DefinitionException(context.formatMessage(I18nConstants.NAMED_ITEMS_ARE_OUT_OF_ORDER_IN_THE_SLICE));
outcome = updateURLs(url, webUrl, currentBase.copy());
// outcome = updateURLs(url, diffItem.copy());
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector, contextPathSrc));
updateFromBase(outcome, currentBase);
outcome.setSlicing(null);
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
throw new DefinitionException(context.formatMessage(I18nConstants.ADDING_WRONG_PATH));
result.getElement().add(outcome);
updateFromDefinition(outcome, diffItem, profileName, trimDifferential, url, srcSD);
removeStatusExtensions(outcome);
@ -1503,7 +1505,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (outcome.getType().size() > 1)
for (TypeRefComponent t : outcome.getType()) {
if (!t.getCode().equals("Reference"))
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") and multiple types ("+typeCode(outcome.getType())+") in profile "+profileName);
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
}
TypeRefComponent t = outcome.getType().get(0);
if (t.getCode().equals("BackboneElement")) {
@ -1520,10 +1522,10 @@ public class ProfileUtilities extends TranslatingUtilities {
} else {
StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));
// if (t.getCode().equals("Extension") && t.hasProfile() && !t.getProfile().contains(":")) {
// lloydfix dt =
// lloydfix dt =
// }
if (dt == null)
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") for type "+typeCode(outcome.getType())+" in profile "+profileName+", but can't find type");
throw new DefinitionException(context.formatMessage(I18nConstants._HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE, diffMatches.get(0).getPath(), differential.getElement().get(diffCursor).getPath(), typeCode(outcome.getType()), profileName));
contextName = dt.getUrl();
int start = diffCursor;
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath()+"."))
@ -1547,7 +1549,7 @@ public class ProfileUtilities extends TranslatingUtilities {
for (ElementDefinition e : result.getElement()) {
i++;
if (e.hasMinElement() && e.getMinElement().getValue()==null)
throw new Error("null min");
throw new Error(context.formatMessage(I18nConstants.NULL_MIN));
}
return res;
}
@ -1555,7 +1557,7 @@ public class ProfileUtilities extends TranslatingUtilities {
private void checkNotGenerating(StructureDefinition sd, String role) {
if (sd.hasUserData("profileutils.snapshot.generating")) {
throw new FHIRException("Attempt to use a snapshot on profile '"+sd.getUrl()+"' as "+role+" before it is generated");
throw new FHIRException(context.formatMessage(I18nConstants.ATTEMPT_TO_USE_A_SNAPSHOT_ON_PROFILE__AS__BEFORE_IT_IS_GENERATED, sd.getUrl(), role));
}
}
@ -1580,12 +1582,12 @@ public class ProfileUtilities extends TranslatingUtilities {
} else if (isPrimitive(Utilities.uncapitalize(t))) {
fixedType = Utilities.uncapitalize(t);
} else {
throw new FHIRException("Unexpected condition in differential: type-slice.type-list.size() == 10 and implicit slice name does not contain a valid type ('"+t+"'?) at "+diffMatches.get(i).getPath()+"/"+diffMatches.get(i).getSliceName());
throw new FHIRException(context.formatMessage(I18nConstants.UNEXPECTED_CONDITION_IN_DIFFERENTIAL_TYPESLICETYPELISTSIZE__10_AND_IMPLICIT_SLICE_NAME_DOES_NOT_CONTAIN_A_VALID_TYPE__AT_, t, diffMatches.get(i).getPath(), diffMatches.get(i).getSliceName()));
}
} else if (diffMatches.get(i).getType().size() == 1) {
fixedType = diffMatches.get(i).getType().get(0).getCode();
} else {
throw new FHIRException("Unexpected condition in differential: type-slice.type-list.size() != 1 at "+diffMatches.get(i).getPath()+"/"+diffMatches.get(i).getSliceName());
throw new FHIRException(context.formatMessage(I18nConstants.UNEXPECTED_CONDITION_IN_DIFFERENTIAL_TYPESLICETYPELISTSIZE__1_AT_, diffMatches.get(i).getPath(), diffMatches.get(i).getSliceName()));
}
return fixedType;
}
@ -2154,14 +2156,14 @@ public class ProfileUtilities extends TranslatingUtilities {
for (int j = 0; j < p.length; j++) {
ok = ok && sp.length > j && (p[j].equals(sp[j]) || isSameBase(p[j], sp[j]));
}
// don't need this debug check - everything is ok
// if (ok != (statedPath.equals(path) || (path.endsWith("[x]") && statedPath.length() > path.length() - 2 &&
// statedPath.substring(0, path.length()-3).equals(path.substring(0, path.length()-3)) &&
// don't need this debug check - everything is ok
// if (ok != (statedPath.equals(path) || (path.endsWith("[x]") && statedPath.length() > path.length() - 2 &&
// statedPath.substring(0, path.length()-3).equals(path.substring(0, path.length()-3)) &&
// (statedPath.length() < path.length() || !statedPath.substring(path.length()).contains("."))))) {
// System.out.println("mismatch in paths: "+statedPath +" vs " +path);
// }
if (ok) {
/*
/*
* Commenting this out because it raises warnings when profiling inherited elements. For example,
* Error: unknown element 'Bundle.meta.profile' (or it is out of order) in profile ... (looking for 'Bundle.entry')
* Not sure we have enough information here to do the check properly. Might be better done when we're sorting the profile?
@ -2317,7 +2319,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (derived.hasMinElement()) {
if (!Base.compareDeep(derived.getMinElement(), base.getMinElement(), false)) {
if (derived.getMin() < base.getMin() && !derived.hasSliceName()) // in a slice, minimum cardinality rules do not apply
if (derived.getMin() < base.getMin() && !derived.hasSliceName()) // in a slice, minimum cardinality rules do not apply
messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.BUSINESSRULE, pn+"."+source.getPath(), "Element "+base.getPath()+": derived min ("+Integer.toString(derived.getMin())+") cannot be less than base min ("+Integer.toString(base.getMin())+")", ValidationMessage.IssueSeverity.ERROR));
base.setMinElement(derived.getMinElement().copy());
} else if (trimDifferential)
@ -2460,7 +2462,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (derived.hasIsSummaryElement()) {
if (!Base.compareDeep(derived.getIsSummaryElement(), base.getIsSummaryElement(), false)) {
if (base.hasIsSummary())
throw new Error("Error in profile "+pn+" at "+derived.getPath()+": Base isSummary = "+base.getIsSummaryElement().asStringValue()+", derived isSummary = "+derived.getIsSummaryElement().asStringValue());
throw new Error(context.formatMessage(I18nConstants.ERROR_IN_PROFILE__AT__BASE_ISSUMMARY___DERIVED_ISSUMMARY__, pn, derived.getPath(), base.getIsSummaryElement().asStringValue(), derived.getIsSummaryElement().asStringValue()));
base.setIsSummaryElement(derived.getIsSummaryElement().copy());
} else if (trimDifferential)
derived.setIsSummaryElement(null);
@ -2587,7 +2589,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ok = true;
}
if (ok && ts.hasTargetProfile()) {
// check that any derived target has a reference chain back to one of the base target profiles
// check that any derived target has a reference chain back to one of the base target profiles
for (UriType u : ts.getTargetProfile()) {
String url = u.getValue();
boolean tgtOk = !td.hasTargetProfile() || td.hasTargetProfile(url);
@ -2606,7 +2608,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
if (!tgtOk) {
if (messages == null) {
throw new FHIRException("Error at "+purl+"#"+derived.getPath()+": The target profile "+url+" is not valid constraint on the base ("+td.getTargetProfile()+")");
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_AT__THE_TARGET_PROFILE__IS_NOT__VALID_CONSTRAINT_ON_THE_BASE_, purl, derived.getPath(), url, td.getTargetProfile()));
} else {
messages.add(new ValidationMessage(Source.InstanceValidator, IssueType.BUSINESSRULE, derived.getPath(), "The target profile "+u.getValue()+" is not a valid constraint on the base ("+td.getTargetProfile()+") at "+derived.getPath(), IssueSeverity.ERROR));
}
@ -2615,7 +2617,7 @@ public class ProfileUtilities extends TranslatingUtilities {
}
}
if (!ok) {
throw new DefinitionException("StructureDefinition "+purl+" at "+derived.getPath()+": illegal constrained type "+t+" from "+b.toString()+" in "+srcSD.getUrl());
throw new DefinitionException(context.formatMessage(I18nConstants.STRUCTUREDEFINITION__AT__ILLEGAL_CONSTRAINED_TYPE__FROM__IN_, purl, derived.getPath(), t, b.toString(), srcSD.getUrl()));
}
}
@ -3194,7 +3196,7 @@ public class ProfileUtilities extends TranslatingUtilities {
try {
return gen.generate(model, imagePath, 0, outputTracker);
} catch (org.hl7.fhir.exceptions.FHIRException e) {
throw new FHIRException("Error generating table for profile " + profile.getUrl() + ": " + e.getMessage(), e);
throw new FHIRException(context.formatMessage(I18nConstants.ERROR_GENERATING_TABLE_FOR_PROFILE__, profile.getUrl(), e.getMessage()), e);
}
}
@ -3204,7 +3206,7 @@ public class ProfileUtilities extends TranslatingUtilities {
while (i < list.size()) {
String[] pathCurrent = list.get(i).getPath().split("\\.");
String[] pathLast = list.get(i-1).getPath().split("\\.");
int firstDiff = 0; // the first entry must be a match
int firstDiff = 0; // the first entry must be a match
while (firstDiff < pathCurrent.length && firstDiff < pathLast.length && pathCurrent[firstDiff].equals(pathLast[firstDiff])) {
firstDiff++;
}
@ -3754,7 +3756,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ref = p.startsWith("http:") || igmode ? p : Utilities.pathURL(corePath, p);
}
fixedUrl = getFixedUrl(ed);
if (fixedUrl != null) {// if its null, we guess that it's not a profiled extension?
if (fixedUrl != null) {// if its null, we guess that it's not a profiled extension?
if (fixedUrl.equals(url))
fixedUrl = null;
else {
@ -4021,7 +4023,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (ed.getPath().equals(path))
return ed;
}
throw new FHIRException("Unable to find element "+path);
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_ELEMENT_, path));
}
@ -4290,7 +4292,7 @@ public class ProfileUtilities extends TranslatingUtilities {
return sd.getType();
if (Utilities.existsInList(value, "SimpleQuantity", "MoneyQuantity"))
return "Quantity";
throw new Error("Internal error - type not known "+value);
throw new Error(context.formatMessage(I18nConstants.INTERNAL_ERROR___TYPE_NOT_KNOWN_, value));
}
@ -4590,7 +4592,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (ed.getType().isEmpty() || isAbstract(ed.getType().get(0).getWorkingCode()) || ed.getType().get(0).getWorkingCode().equals(ed.getPath())) {
if (ed.hasType() && "Resource".equals(ed.getType().get(0).getWorkingCode()) && child.getSelf().getType().get(0).hasProfile()) {
if (child.getSelf().getType().get(0).getProfile().size() > 1) {
throw new FHIRException("Unhandled situation: resource is profiled to more than one option - cannot sort profile");
throw new FHIRException(context.formatMessage(I18nConstants.UNHANDLED_SITUATION_RESOURCE_IS_PROFILED_TO_MORE_THAN_ONE_OPTION__CANNOT_SORT_PROFILE));
}
StructureDefinition profile = context.fetchResource(StructureDefinition.class, child.getSelf().getType().get(0).getProfile().get(0).getValue());
while (profile != null && profile.getDerivation() == TypeDerivationRule.CONSTRAINT) {
@ -4613,12 +4615,12 @@ public class ProfileUtilities extends TranslatingUtilities {
} else if (ed.getType().size() == 1 && !ed.getType().get(0).getWorkingCode().equals("*")) {
StructureDefinition profile = context.fetchResource(StructureDefinition.class, sdNs(ed.getType().get(0).getWorkingCode()));
if (profile==null)
throw new FHIRException("Unable to resolve profile " + sdNs(ed.getType().get(0).getWorkingCode()) + " in element " + ed.getPath());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_PROFILE__IN_ELEMENT_, sdNs(ed.getType().get(0).getWorkingCode()), ed.getPath()));
ccmp = new ElementDefinitionComparer(false, profile.getSnapshot().getElement(), ed.getType().get(0).getWorkingCode(), child.getSelf().getPath().length(), cmp.name);
} else if (child.getSelf().getType().size() == 1) {
StructureDefinition profile = context.fetchResource(StructureDefinition.class, sdNs(child.getSelf().getType().get(0).getWorkingCode()));
if (profile==null)
throw new FHIRException("Unable to resolve profile " + sdNs(ed.getType().get(0).getWorkingCode()) + " in element " + ed.getPath());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_PROFILE__IN_ELEMENT_, sdNs(ed.getType().get(0).getWorkingCode()), ed.getPath()));
ccmp = new ElementDefinitionComparer(false, profile.getSnapshot().getElement(), child.getSelf().getType().get(0).getWorkingCode(), child.getSelf().getPath().length(), cmp.name);
} else if (ed.getPath().endsWith("[x]") && !child.getSelf().getPath().endsWith("[x]")) {
String edLastNode = ed.getPath().replaceAll("(.*\\.)*(.*)", "$2");
@ -4628,12 +4630,12 @@ public class ProfileUtilities extends TranslatingUtilities {
p = Utilities.uncapitalize(p);
StructureDefinition sd = context.fetchResource(StructureDefinition.class, sdNs(p));
if (sd == null)
throw new Error("Unable to find profile '"+p+"' at "+ed.getId());
throw new Error(context.formatMessage(I18nConstants.UNABLE_TO_FIND_PROFILE__AT_, p, ed.getId()));
ccmp = new ElementDefinitionComparer(false, sd.getSnapshot().getElement(), p, child.getSelf().getPath().length(), cmp.name);
} else if (child.getSelf().hasType() && child.getSelf().getType().get(0).getWorkingCode().equals("Reference")) {
for (TypeRefComponent t: child.getSelf().getType()) {
if (!t.getWorkingCode().equals("Reference")) {
throw new Error("Can't have children on an element with a polymorphic type - you must slice and constrain the types first (sortElements: "+ed.getPath()+":"+typeCode(ed.getType())+")");
throw new Error(context.formatMessage(I18nConstants.CANT_HAVE_CHILDREN_ON_AN_ELEMENT_WITH_A_POLYMORPHIC_TYPE__YOU_MUST_SLICE_AND_CONSTRAIN_THE_TYPES_FIRST_SORTELEMENTS_, ed.getPath(), typeCode(ed.getType())));
}
}
StructureDefinition profile = context.fetchResource(StructureDefinition.class, sdNs(ed.getType().get(0).getWorkingCode()));
@ -4641,7 +4643,7 @@ public class ProfileUtilities extends TranslatingUtilities {
} else if (!child.getSelf().hasType() && ed.getType().get(0).getWorkingCode().equals("Reference")) {
for (TypeRefComponent t: ed.getType()) {
if (!t.getWorkingCode().equals("Reference")) {
throw new Error("Not handled yet (sortElements: "+ed.getPath()+":"+typeCode(ed.getType())+")");
throw new Error(context.formatMessage(I18nConstants.NOT_HANDLED_YET_SORTELEMENTS_, ed.getPath(), typeCode(ed.getType())));
}
}
StructureDefinition profile = context.fetchResource(StructureDefinition.class, sdNs(ed.getType().get(0).getWorkingCode()));
@ -4650,7 +4652,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// this is allowed if we only profile the extensions
StructureDefinition profile = context.fetchResource(StructureDefinition.class, sdNs("Element"));
if (profile==null)
throw new FHIRException("Unable to resolve profile " + sdNs(ed.getType().get(0).getWorkingCode()) + " in element " + ed.getPath());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_PROFILE__IN_ELEMENT_, sdNs(ed.getType().get(0).getWorkingCode()), ed.getPath()));
ccmp = new ElementDefinitionComparer(false, profile.getSnapshot().getElement(), "Element", child.getSelf().getPath().length(), cmp.name);
// throw new Error("Not handled yet (sortElements: "+ed.getPath()+":"+typeCode(ed.getType())+")");
}
@ -4719,9 +4721,9 @@ public class ProfileUtilities extends TranslatingUtilities {
// generate schematrons for the rules in a structure definition
public void generateSchematrons(OutputStream dest, StructureDefinition structure) throws IOException, DefinitionException {
if (structure.getDerivation() != TypeDerivationRule.CONSTRAINT)
throw new DefinitionException("not the right kind of structure to generate schematrons for");
throw new DefinitionException(context.formatMessage(I18nConstants.NOT_THE_RIGHT_KIND_OF_STRUCTURE_TO_GENERATE_SCHEMATRONS_FOR));
if (!structure.hasSnapshot())
throw new DefinitionException("needs a snapshot");
throw new DefinitionException(context.formatMessage(I18nConstants.NEEDS_A_SNAPSHOT));
StructureDefinition base = context.fetchResource(StructureDefinition.class, structure.getBaseDefinition());
@ -4737,7 +4739,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// generate a CSV representation of the structure definition
public void generateCsvs(OutputStream dest, StructureDefinition structure, boolean asXml) throws IOException, DefinitionException, Exception {
if (!structure.hasSnapshot())
throw new DefinitionException("needs a snapshot");
throw new DefinitionException(context.formatMessage(I18nConstants.NEEDS_A_SNAPSHOT));
CSVWriter csv = new CSVWriter(dest, structure, asXml);
@ -4753,7 +4755,7 @@ public class ProfileUtilities extends TranslatingUtilities {
System.out.println("no structure!");
}
if (!structure.hasSnapshot()) {
throw new DefinitionException("needs a snapshot");
throw new DefinitionException(context.formatMessage(I18nConstants.NEEDS_A_SNAPSHOT));
}
XLSXWriter xlsx = new XLSXWriter(dest, structure, asXml, hideMustSupportFalse);
@ -4913,7 +4915,7 @@ public class ProfileUtilities extends TranslatingUtilities {
for (ElementDefinition ed : list) {
List<String> paths = new ArrayList<String>();
if (!ed.hasPath())
throw new DefinitionException("No path on element Definition "+Integer.toString(list.indexOf(ed))+" in "+name);
throw new DefinitionException(context.formatMessage(I18nConstants.NO_PATH_ON_ELEMENT_DEFINITION__IN_, Integer.toString(list.indexOf(ed)), name));
sliceInfo.seeElement(ed);
String[] pl = ed.getPath().split("\\.");
for (int i = paths.size(); i < pl.length; i++) // -1 because the last path is in focus
@ -4937,7 +4939,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ed.setId(bs);
if (idList.containsKey(bs)) {
if (exception || messages == null) {
throw new DefinitionException("Same id '"+bs+"'on multiple elements "+idList.get(bs)+"/"+ed.getPath()+" in "+name);
throw new DefinitionException(context.formatMessage(I18nConstants.SAME_ID_ON_MULTIPLE_ELEMENTS__IN_, bs, idList.get(bs), ed.getPath(), name));
} else
messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.BUSINESSRULE, name+"."+bs, "Duplicate Element id "+bs, ValidationMessage.IssueSeverity.ERROR));
}
@ -5131,7 +5133,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (sd.hasBaseDefinition()) {
StructureDefinition base = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition());
if (base == null)
throw new FHIRException("Unable to find base definition for logical model: "+sd.getBaseDefinition()+" from "+sd.getUrl());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_BASE_DEFINITION_FOR_LOGICAL_MODEL__FROM_, sd.getBaseDefinition(), sd.getUrl()));
copyElements(sd, base.getSnapshot().getElement());
}
copyElements(sd, sd.getDifferential().getElement());
@ -5223,7 +5225,7 @@ public class ProfileUtilities extends TranslatingUtilities {
else if (slicer.getPath().equals("Bundle.entry"))
slicer.getSlicing().addDiscriminator().setType(DiscriminatorType.VALUE).setPath("resource.@profile");
else
throw new Error("No slicing for "+slicer.getPath());
throw new Error("No slicing for "+slicer.getPath());
}
public class SpanEntry {
@ -5342,7 +5344,7 @@ public class ProfileUtilities extends TranslatingUtilities {
ElementDefinition ned = ed;
while (ned != null && ned.getPath().contains(".")) {
ned = findParent(ned, list);
if (ned != null) { // todo: this can happen if we've walked into a resoruce. Not sure what to about that?
if (ned != null) { // todo: this can happen if we've walked into a resoruce. Not sure what to about that?
if ("0".equals(ned.getMax()))
max = 0;
else if (!ned.getMax().equals("1") && !ned.hasSlicing())

View File

@ -22,17 +22,18 @@ package org.hl7.fhir.r5.context;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.ResourceBundle;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
@ -41,7 +42,6 @@ import org.hl7.fhir.exceptions.DefinitionException;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.exceptions.TerminologyServiceException;
import org.hl7.fhir.r5.conformance.ProfileUtilities;
import org.hl7.fhir.r5.context.BaseWorkerContext.MetadataResourceVersionComparator;
import org.hl7.fhir.r5.context.IWorkerContext.ILoggingService.LogCategory;
import org.hl7.fhir.r5.context.TerminologyCache.CacheToken;
import org.hl7.fhir.r5.model.BooleanType;
@ -82,6 +82,7 @@ import org.hl7.fhir.r5.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
import org.hl7.fhir.r5.terminologies.ValueSetExpanderSimple;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.client.ToolingClientLogger;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.OIDUtils;
import org.hl7.fhir.utilities.TranslationServices;
import org.hl7.fhir.utilities.Utilities;
@ -95,6 +96,7 @@ import com.google.gson.JsonObject;
public abstract class BaseWorkerContext implements IWorkerContext {
private ResourceBundle i18Nmessages;
private Locale locale;
public class MetadataResourceVersionComparator<T extends CanonicalResource> implements Comparator<T> {
@ -166,19 +168,23 @@ public abstract class BaseWorkerContext implements IWorkerContext {
private boolean tlogging = true;
public BaseWorkerContext() throws FileNotFoundException, IOException, FHIRException {
super();
txCache = new TerminologyCache(lock, null);
setValidationMessageLanguage(getLocale());
}
public BaseWorkerContext(CanonicalResourceManager<CodeSystem> codeSystems, CanonicalResourceManager<ValueSet> valueSets, CanonicalResourceManager<ConceptMap> maps, CanonicalResourceManager<StructureDefinition> profiles,
public BaseWorkerContext(Locale locale) throws FileNotFoundException, IOException, FHIRException {
txCache = new TerminologyCache(lock, null);
setValidationMessageLanguage(locale);
}
public BaseWorkerContext(CanonicalResourceManager<CodeSystem> codeSystems, CanonicalResourceManager<ValueSet> valueSets, CanonicalResourceManager<ConceptMap> maps, CanonicalResourceManager<StructureDefinition> profiles,
CanonicalResourceManager<ImplementationGuide> guides) throws FileNotFoundException, IOException, FHIRException {
super();
this();
this.codeSystems = codeSystems;
this.valueSets = valueSets;
this.maps = maps;
this.structures = profiles;
this.guides = guides;
txCache = new TerminologyCache(lock, null);
}
protected void copy(BaseWorkerContext other) {
@ -232,7 +238,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
if (Utilities.existsInList(url, "http://hl7.org/fhir/SearchParameter/example")) {
return;
}
throw new DefinitionException("Duplicate Resource " + url);
throw new DefinitionException(formatMessage(I18nConstants.DUPLICATE_RESOURCE_, url));
}
if (r instanceof StructureDefinition)
structures.see((StructureDefinition) m);
@ -306,7 +312,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
return laterVersion(newParts[i], oldParts[i]);
}
// This should never happen
throw new Error("Delimited versions have exact match for delimiter '"+delimiter+"' : "+newParts+" vs "+oldParts);
throw new Error(formatMessage(I18nConstants.DELIMITED_VERSIONS_HAVE_EXACT_MATCH_FOR_DELIMITER____VS_, delimiter, newParts, oldParts));
}
protected <T extends CanonicalResource> void seeMetadataResource(T r, Map<String, T> map, List<T> list, boolean addId) throws FHIRException {
@ -420,25 +426,12 @@ public abstract class BaseWorkerContext implements IWorkerContext {
this.expandCodesLimit = expandCodesLimit;
}
@Override
public Locale getLocale() {
if (Objects.nonNull(locale)){
return locale;
} else {
return Locale.US;
}
}
@Override
public void setLocale(Locale locale) {
this.locale = locale;
}
@Override
public ValueSetExpansionOutcome expandVS(ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heirarchical) throws FHIRException {
ValueSet vs = null;
vs = fetchResource(ValueSet.class, binding.getValueSet());
if (vs == null)
throw new FHIRException("Unable to resolve value Set "+binding.getValueSet());
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_VALUE_SET_, binding.getValueSet()));
return expandVS(vs, cacheOk, heirarchical);
}
@ -457,7 +450,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
p.setParameter("excludeNested", !hierarchical);
if (noTerminologyServer)
return new ValueSetExpansionOutcome("Error expanding ValueSet: running without terminology services", TerminologyServiceErrorClass.NOSERVICE);
return new ValueSetExpansionOutcome(formatMessage(I18nConstants.ERROR_EXPANDING_VALUESET_RUNNING_WITHOUT_TERMINOLOGY_SERVICES), TerminologyServiceErrorClass.NOSERVICE);
Map<String, String> params = new HashMap<String, String>();
params.put("_limit", Integer.toString(expandCodesLimit ));
params.put("_incomplete", "true");
@ -477,19 +470,19 @@ public abstract class BaseWorkerContext implements IWorkerContext {
@Override
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical) {
if (expParameters == null)
throw new Error("No Expansion Parameters provided");
throw new Error(formatMessage(I18nConstants.NO_EXPANSION_PARAMETERS_PROVIDED));
Parameters p = expParameters.copy();
return expandVS(vs, cacheOk, heirarchical, p);
}
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, Parameters p) {
if (p == null)
throw new Error("No Parameters provided to expandVS");
throw new Error(formatMessage(I18nConstants.NO_PARAMETERS_PROVIDED_TO_EXPANDVS));
if (vs.hasExpansion()) {
return new ValueSetExpansionOutcome(vs.copy());
}
if (!vs.hasUrl())
throw new Error("no value set");
throw new Error(formatMessage(I18nConstants.NO_VALUE_SET));
CacheToken cacheToken = txCache.generateExpandToken(vs, heirarchical);
ValueSetExpansionOutcome res;
@ -506,7 +499,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
ValueSetExpanderSimple vse = new ValueSetExpanderSimple(this);
res = vse.doExpand(vs, p);
if (!res.getValueset().hasUrl())
throw new Error("no url in expand value set");
throw new Error(formatMessage(I18nConstants.NO_URL_IN_EXPAND_VALUE_SET));
txCache.cacheExpansion(cacheToken, res, TerminologyCache.TRANSIENT);
return res;
} catch (Exception e) {
@ -514,7 +507,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
// if that failed, we try to expand on the server
if (noTerminologyServer)
return new ValueSetExpansionOutcome("Error expanding ValueSet: running without terminology services", TerminologyServiceErrorClass.NOSERVICE);
return new ValueSetExpansionOutcome(formatMessage(I18nConstants.ERROR_EXPANDING_VALUESET_RUNNING_WITHOUT_TERMINOLOGY_SERVICES), TerminologyServiceErrorClass.NOSERVICE);
Map<String, String> params = new HashMap<String, String>();
params.put("_limit", Integer.toString(expandCodesLimit ));
params.put("_incomplete", "true");
@ -524,7 +517,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
if (!result.hasUrl())
result.setUrl(vs.getUrl());
if (!result.hasUrl())
throw new Error("no url in expand value set 2");
throw new Error(formatMessage(I18nConstants.NO_URL_IN_EXPAND_VALUE_SET_2));
res = new ValueSetExpansionOutcome(result).setTxLink(txLog.getLastId());
} catch (Exception e) {
res = new ValueSetExpansionOutcome(e.getMessage() == null ? e.getClass().getName() : e.getMessage(), TerminologyServiceErrorClass.UNKNOWN).setTxLink(txLog == null ? null : txLog.getLastId());
@ -584,12 +577,12 @@ public abstract class BaseWorkerContext implements IWorkerContext {
}
if (!options.isUseServer()) {
return new ValidationResult(IssueSeverity.WARNING, "Unable to validate code without using server", TerminologyServiceErrorClass.BLOCKED_BY_OPTIONS);
return new ValidationResult(IssueSeverity.WARNING,formatMessage(I18nConstants.UNABLE_TO_VALIDATE_CODE_WITHOUT_USING_SERVER), TerminologyServiceErrorClass.BLOCKED_BY_OPTIONS);
}
// if that failed, we try to validate on the server
if (noTerminologyServer) {
return new ValidationResult(IssueSeverity.ERROR, "Error validating code: running without terminology services", TerminologyServiceErrorClass.NOSERVICE);
return new ValidationResult(IssueSeverity.ERROR,formatMessage(I18nConstants.ERROR_VALIDATING_CODE_RUNNING_WITHOUT_TERMINOLOGY_SERVICES), TerminologyServiceErrorClass.NOSERVICE);
}
String csumm = txCache != null ? txCache.summary(code) : null;
if (txCache != null) {
@ -664,15 +657,15 @@ public abstract class BaseWorkerContext implements IWorkerContext {
pin.addParameter().setName("valueSet").setResource(vs);
for (ParametersParameterComponent pp : pin.getParameter())
if (pp.getName().equals("profile"))
throw new Error("Can only specify profile in the context");
throw new Error(formatMessage(I18nConstants.CAN_ONLY_SPECIFY_PROFILE_IN_THE_CONTEXT));
if (expParameters == null)
throw new Error("No ExpansionProfile provided");
throw new Error(formatMessage(I18nConstants.NO_EXPANSIONPROFILE_PROVIDED));
pin.addParameter().setName("profile").setResource(expParameters);
if (txLog != null) {
txLog.clearLastId();
}
if (txClient == null) {
throw new FHIRException("Attempt to use Terminology server when no Terminology server is available");
throw new FHIRException(formatMessage(I18nConstants.ATTEMPT_TO_USE_TERMINOLOGY_SERVER_WHEN_NO_TERMINOLOGY_SERVER_IS_AVAILABLE));
}
Parameters pOut;
if (vs == null)
@ -879,7 +872,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
}
if (supportedCodeSystems.contains(uri))
return null;
throw new FHIRException("not done yet: can't fetch "+uri);
throw new FHIRException(formatMessage(I18nConstants.NOT_DONE_YET_CANT_FETCH_, uri));
}
}
@ -925,10 +918,10 @@ public abstract class BaseWorkerContext implements IWorkerContext {
if (parts.length >= 2) {
if (!Utilities.noString(type))
if (!type.equals(parts[parts.length-2]))
throw new Error("Resource type mismatch for "+type+" / "+uri);
throw new Error(formatMessage(I18nConstants.RESOURCE_TYPE_MISMATCH_FOR___, type, uri));
return allResourcesById.get(parts[parts.length-2]).get(parts[parts.length-1]);
} else
throw new Error("Unable to process request for resource for "+type+" / "+uri);
throw new Error(formatMessage(I18nConstants.UNABLE_TO_PROCESS_REQUEST_FOR_RESOURCE_FOR___, type, uri));
}
}
@ -1288,5 +1281,36 @@ public abstract class BaseWorkerContext implements IWorkerContext {
return binaries;
}
@Override
public Locale getLocale() {
if (Objects.nonNull(locale)){
return locale;
} else {
return Locale.US;
}
}
@Override
public void setLocale(Locale locale) {
this.locale = locale;
setValidationMessageLanguage(getLocale());
}
@Override
public String formatMessage(String theMessage, Object... theMessageArguments) {
String message = theMessage;
if (Objects.nonNull(i18Nmessages) && i18Nmessages.containsKey(theMessage)) {
if (Objects.nonNull(theMessageArguments) && theMessageArguments.length > 0) {
message = MessageFormat.format(i18Nmessages.getString(theMessage), theMessageArguments);
} else {
message = i18Nmessages.getString(theMessage);
}
}
return message;
}
@Override
public void setValidationMessageLanguage(Locale locale) {
i18Nmessages = ResourceBundle.getBundle("Messages", locale );
}
}

View File

@ -326,13 +326,17 @@ public interface IWorkerContext {
* @return
* @throws FHIRException
*/
public ValueSetExpansionOutcome expandVS(ConceptSetComponent inc, boolean hierarchical) throws TerminologyServiceException;
ValueSetExpansionOutcome expandVS(ConceptSetComponent inc, boolean hierarchical) throws TerminologyServiceException;
Locale getLocale();
Locale getLocale();
void setLocale(Locale locale);
void setLocale(Locale locale);
public class ValidationResult {
String formatMessage(String theMessage, Object... theMessageArguments);
void setValidationMessageLanguage(Locale locale);
class ValidationResult {
private ConceptDefinitionComponent definition;
private IssueSeverity severity;
private String message;

View File

@ -35,6 +35,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.zip.ZipEntry;
@ -72,6 +73,7 @@ import org.hl7.fhir.r5.utils.INarrativeGenerator;
import org.hl7.fhir.r5.utils.IResourceValidator;
import org.hl7.fhir.r5.utils.NarrativeGenerator;
import org.hl7.fhir.utilities.CSFileInputStream;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.cache.NpmPackage;
@ -117,11 +119,20 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
public SimpleWorkerContext() throws FileNotFoundException, IOException, FHIRException {
super();
}
public SimpleWorkerContext(Locale locale) throws FileNotFoundException, IOException, FHIRException {
super(locale);
}
public SimpleWorkerContext(SimpleWorkerContext other) throws FileNotFoundException, IOException, FHIRException {
super();
copy(other);
}
public SimpleWorkerContext(SimpleWorkerContext other, Locale locale) throws FileNotFoundException, IOException, FHIRException {
super(locale);
copy(other);
}
protected void copy(SimpleWorkerContext other) {
super.copy(other);
@ -249,7 +260,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
txClient.setLogger(txLog);
return txClient.getCapabilitiesStatementQuick().getSoftware().getVersion();
} catch (Exception e) {
throw new FHIRException("Unable to connect to terminology server. Use parameter '-tx n/a' tun run without using terminology services to validate LOINC, SNOMED, ICD-X etc. Error = "+e.getMessage(), e);
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_CONNECT_TO_TERMINOLOGY_SERVER_USE_PARAMETER_TX_NA_TUN_RUN_WITHOUT_USING_TERMINOLOGY_SERVICES_TO_VALIDATE_LOINC_SNOMED_ICDX_ETC_ERROR__, e.getMessage()), e);
}
}
@ -267,9 +278,9 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
f = xml.parse(stream);
}
} catch (DataFormatException e1) {
throw new org.hl7.fhir.exceptions.FHIRFormatError("Error parsing "+name+":" +e1.getMessage(), e1);
throw new org.hl7.fhir.exceptions.FHIRFormatError(formatMessage(I18nConstants.ERROR_PARSING_, name, e1.getMessage()), e1);
} catch (Exception e1) {
throw new org.hl7.fhir.exceptions.FHIRFormatError("Error parsing "+name+":" +e1.getMessage(), e1);
throw new org.hl7.fhir.exceptions.FHIRFormatError(formatMessage(I18nConstants.ERROR_PARSING_, name, e1.getMessage()), e1);
}
if (f instanceof Bundle) {
Bundle bnd = (Bundle) f;
@ -325,7 +336,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
try {
loadDefinitionItem(s, pi.load("package", s), loader, filter);
} catch (FHIRException | IOException e) {
throw new FHIRException("Error reading "+s+" from package "+pi.name()+"#"+pi.version()+": "+e.getMessage(), e);
throw new FHIRException(formatMessage(I18nConstants.ERROR_READING__FROM_PACKAGE__, s, pi.name(), pi.version(), e.getMessage()), e);
}
}
for (String s : pi.list("other")) {
@ -377,7 +388,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
if (version == null)
version = s.substring(8);
else if (!version.equals(s.substring(8)))
throw new DefinitionException("Version mismatch. The context has version "+version+" loaded, and the new content being loaded is version "+s.substring(8));
throw new DefinitionException(formatMessage(I18nConstants.VERSION_MISMATCH_THE_CONTEXT_HAS_VERSION__LOADED_AND_THE_NEW_CONTENT_BEING_LOADED_IS_VERSION_, version, s.substring(8)));
}
if (s.startsWith("revision="))
revision = s.substring(9);
@ -397,7 +408,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
case JSON: return newJsonParser();
case XML: return newXmlParser();
default:
throw new Error("Parser Type "+type.toString()+" not supported");
throw new Error(formatMessage(I18nConstants.PARSER_TYPE__NOT_SUPPORTED, type.toString()));
}
}
@ -407,7 +418,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
return new JsonParser();
if (type.equalsIgnoreCase("XML"))
return new XmlParser();
throw new Error("Parser Type "+type.toString()+" not supported");
throw new Error(formatMessage(I18nConstants.PARSER_TYPE__NOT_SUPPORTED, type.toString()));
}
@Override
@ -427,7 +438,7 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
@Override
public IResourceValidator newValidator() throws FHIRException {
if (validatorFactory == null)
throw new Error("No validator configured");
throw new Error(formatMessage(I18nConstants.NO_VALIDATOR_CONFIGURED));
return validatorFactory.makeValidator(this);
}
@ -655,13 +666,13 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
public void generateSnapshot(StructureDefinition p, boolean logical) throws DefinitionException, FHIRException {
if (!p.hasSnapshot() && (logical || p.getKind() != StructureDefinitionKind.LOGICAL)) {
if (!p.hasBaseDefinition())
throw new DefinitionException("Profile "+p.getName()+" ("+p.getUrl()+") has no base and no snapshot");
throw new DefinitionException(formatMessage(I18nConstants.PROFILE___HAS_NO_BASE_AND_NO_SNAPSHOT, p.getName(), p.getUrl()));
StructureDefinition sd = fetchResource(StructureDefinition.class, p.getBaseDefinition());
if (sd == null && "http://hl7.org/fhir/StructureDefinition/Base".equals(p.getBaseDefinition())) {
sd = ProfileUtilities.makeBaseDefinition(p.getFhirVersion());
}
if (sd == null) {
throw new DefinitionException("Profile "+p.getName()+" ("+p.getUrl()+") base "+p.getBaseDefinition()+" could not be resolved");
throw new DefinitionException(formatMessage(I18nConstants.PROFILE___BASE__COULD_NOT_BE_RESOLVED, p.getName(), p.getUrl(), p.getBaseDefinition()));
}
List<ValidationMessage> msgs = new ArrayList<ValidationMessage>();
List<String> errors = new ArrayList<String>();
@ -677,10 +688,10 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
pu.generateSnapshot(sd, p, p.getUrl(), Utilities.extractBaseUrl(sd.getUserString("path")), p.getName());
for (ValidationMessage msg : msgs) {
if ((!ignoreProfileErrors && msg.getLevel() == ValidationMessage.IssueSeverity.ERROR) || msg.getLevel() == ValidationMessage.IssueSeverity.FATAL)
throw new DefinitionException("Profile "+p.getName()+" ("+p.getUrl()+"), element "+msg.getLocation()+". Error generating snapshot: "+msg.getMessage());
throw new DefinitionException(formatMessage(I18nConstants.PROFILE___ELEMENT__ERROR_GENERATING_SNAPSHOT_, p.getName(), p.getUrl(), msg.getLocation(), msg.getMessage()));
}
if (!p.hasSnapshot())
throw new FHIRException("Profile "+p.getName()+" ("+p.getUrl()+"). Error generating snapshot");
throw new FHIRException(formatMessage(I18nConstants.PROFILE___ERROR_GENERATING_SNAPSHOT, p.getName(), p.getUrl()));
pu = null;
}
}

View File

@ -9,9 +9,9 @@ package org.hl7.fhir.r5.elementmodel;
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -45,6 +45,7 @@ import org.hl7.fhir.r5.formats.JsonCreatorCanonical;
import org.hl7.fhir.r5.formats.JsonCreatorGson;
import org.hl7.fhir.r5.model.ElementDefinition.TypeRefComponent;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.json.JsonTrackingParser;
@ -90,20 +91,20 @@ public class JsonParser extends ParserBase {
map = new IdentityHashMap<JsonElement, LocationData>();
String source = TextFile.streamToString(stream);
if (policy == ValidationPolicy.EVERYTHING) {
JsonObject obj = null;
JsonObject obj = null;
try {
obj = JsonTrackingParser.parse(source, map);
} catch (Exception e) {
logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing JSON: "+e.getMessage(), IssueSeverity.FATAL);
} catch (Exception e) {
logError(-1, -1,context.formatMessage(I18nConstants.DOCUMENT), IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_, e.getMessage()), IssueSeverity.FATAL);
return null;
}
assert (map.containsKey(obj));
return parse(obj);
return parse(obj);
} else {
JsonObject obj = JsonTrackingParser.parse(source, null); // (JsonObject) new com.google.gson.JsonParser().parse(source);
// assert (map.containsKey(obj));
return parse(obj);
}
return parse(obj);
}
}
public Element parse(JsonObject object, Map<JsonElement, LocationData> map) throws FHIRException {
@ -114,7 +115,7 @@ public class JsonParser extends ParserBase {
public Element parse(JsonObject object) throws FHIRException {
JsonElement rt = object.get("resourceType");
if (rt == null) {
logError(line(object), col(object), "$", IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL);
logError(line(object), col(object), "$", IssueType.INVALID, context.formatMessage(I18nConstants.UNABLE_TO_FIND_RESOURCETYPE_PROPERTY), IssueSeverity.FATAL);
return null;
} else {
String name = rt.getAsString();
@ -144,13 +145,13 @@ public class JsonParser extends ParserBase {
// }
}
if (!found)
logError(line(object), col(object), path, IssueType.INVALID, "Object must have some content", IssueSeverity.ERROR);
logError(line(object), col(object), path, IssueType.INVALID, context.formatMessage(I18nConstants.OBJECT_MUST_HAVE_SOME_CONTENT), IssueSeverity.ERROR);
}
}
private void parseChildren(String path, JsonObject object, Element context, boolean hasResourceType) throws FHIRException {
reapComments(object, context);
List<Property> properties = context.getProperty().getChildProperties(context.getName(), null);
private void parseChildren(String path, JsonObject object, Element element, boolean hasResourceType) throws FHIRException {
reapComments(object, element);
List<Property> properties = element.getProperty().getChildProperties(element.getName(), null);
Set<String> processed = new HashSet<String>();
if (hasResourceType)
processed.add("resourceType");
@ -159,14 +160,14 @@ public class JsonParser extends ParserBase {
// note that we do not trouble ourselves to maintain the wire format order here - we don't even know what it was anyway
// first pass: process the properties
for (Property property : properties) {
parseChildItem(path, object, context, processed, property);
parseChildItem(path, object, element, processed, property);
}
// second pass: check for things not processed
if (policy != ValidationPolicy.NONE) {
for (Entry<String, JsonElement> e : object.entrySet()) {
if (!processed.contains(e.getKey())) {
logError(line(e.getValue()), col(e.getValue()), path, IssueType.STRUCTURE, "Unrecognised property '@"+e.getKey()+"'", IssueSeverity.ERROR);
logError(line(e.getValue()), col(e.getValue()), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNRECOGNISED_PROPERTY_, e.getKey()), IssueSeverity.ERROR);
}
}
}
@ -191,7 +192,7 @@ public class JsonParser extends ParserBase {
}
}
private void parseChildComplex(String path, JsonObject object, Element context, Set<String> processed, Property property, String name) throws FHIRException {
private void parseChildComplex(String path, JsonObject object, Element element, Set<String> processed, Property property, String name) throws FHIRException {
processed.add(name);
String npath = path+"."+property.getName();
JsonElement e = object.get(name);
@ -199,14 +200,14 @@ public class JsonParser extends ParserBase {
JsonArray arr = (JsonArray) e;
int c = 0;
for (JsonElement am : arr) {
parseChildComplexInstance(npath+"["+c+"]", object, context, property, name, am);
parseChildComplexInstance(npath+"["+c+"]", object, element, property, name, am);
c++;
}
} else {
if (property.isList()) {
logError(line(e), col(e), npath, IssueType.INVALID, "This property must be an Array, not "+describeType(e), IssueSeverity.ERROR);
logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_AN_ARRAY_NOT_, describeType(e)), IssueSeverity.ERROR);
}
parseChildComplexInstance(npath, object, context, property, name, e);
parseChildComplexInstance(npath, object, element, property, name, e);
}
}
@ -222,20 +223,20 @@ public class JsonParser extends ParserBase {
return null;
}
private void parseChildComplexInstance(String npath, JsonObject object, Element context, Property property, String name, JsonElement e) throws FHIRException {
private void parseChildComplexInstance(String npath, JsonObject object, Element element, Property property, String name, JsonElement e) throws FHIRException {
if (e instanceof JsonObject) {
JsonObject child = (JsonObject) e;
Element n = new Element(name, property).markLocation(line(child), col(child));
checkObject(child, npath);
context.getChildren().add(n);
element.getChildren().add(n);
if (property.isResource())
parseResource(npath, child, n, property);
else
parseChildren(npath, child, n, false);
} else
logError(line(e), col(e), npath, IssueType.INVALID, "This property must be "+(property.isList() ? "an Array" : "an Object")+", not "+describe(e), IssueSeverity.ERROR);
} else
logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE__NOT_, (property.isList() ? "an Array" : "an Object"), describe(e)), IssueSeverity.ERROR);
}
private String describe(JsonElement e) {
if (e instanceof JsonArray) {
return "an array";
@ -246,21 +247,21 @@ public class JsonParser extends ParserBase {
return "a primitive property";
}
private void parseChildPrimitive(JsonObject object, Element context, Set<String> processed, Property property, String path, String name) throws FHIRException {
private void parseChildPrimitive(JsonObject object, Element element, Set<String> processed, Property property, String path, String name) throws FHIRException {
String npath = path+"."+property.getName();
processed.add(name);
processed.add("_"+name);
JsonElement main = object.has(name) ? object.get(name) : null;
JsonElement main = object.has(name) ? object.get(name) : null;
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
if (main != null || fork != null) {
if (property.isList()) {
boolean ok = true;
if (!(main == null || main instanceof JsonArray)) {
logError(line(main), col(main), npath, IssueType.INVALID, "This property must be an Array, not a "+describe(main), IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_AN_ARRAY_NOT_A_, describe(main)), IssueSeverity.ERROR);
ok = false;
}
if (!(fork == null || fork instanceof JsonArray)) {
logError(line(fork), col(fork), npath, IssueType.INVALID, "This base property must be an Array, not a "+describe(main), IssueSeverity.ERROR);
logError(line(fork), col(fork), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_BASE_PROPERTY_MUST_BE_AN_ARRAY_NOT_A_, describe(main)), IssueSeverity.ERROR);
ok = false;
}
if (ok) {
@ -269,11 +270,11 @@ public class JsonParser extends ParserBase {
for (int i = 0; i < Math.max(arrC(arr1), arrC(arr2)); i++) {
JsonElement m = arrI(arr1, i);
JsonElement f = arrI(arr2, i);
parseChildPrimitiveInstance(context, property, name, npath, m, f);
parseChildPrimitiveInstance(element, property, name, npath, m, f);
}
}
} else {
parseChildPrimitiveInstance(context, property, name, npath, main, fork);
parseChildPrimitiveInstance(element, property, name, npath, main, fork);
}
}
}
@ -286,15 +287,16 @@ public class JsonParser extends ParserBase {
return arr == null ? 0 : arr.size();
}
private void parseChildPrimitiveInstance(Element context, Property property, String name, String npath,
private void parseChildPrimitiveInstance(Element element, Property property, String name, String npath,
JsonElement main, JsonElement fork) throws FHIRException {
if (main != null && !(main instanceof JsonPrimitive))
logError(line(main), col(main), npath, IssueType.INVALID, "This property must be an simple value, not "+describe(main), IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(
I18nConstants.THIS_PROPERTY_MUST_BE_AN_SIMPLE_VALUE_NOT_, describe(main)), IssueSeverity.ERROR);
else if (fork != null && !(fork instanceof JsonObject))
logError(line(fork), col(fork), npath, IssueType.INVALID, "This property must be an object, not "+describe(fork), IssueSeverity.ERROR);
logError(line(fork), col(fork), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_AN_OBJECT_NOT_, describe(fork)), IssueSeverity.ERROR);
else {
Element n = new Element(name, property).markLocation(line(main != null ? main : fork), col(main != null ? main : fork));
context.getChildren().add(n);
element.getChildren().add(n);
if (main != null) {
JsonPrimitive p = (JsonPrimitive) main;
if (p.isNumber() && p.getAsNumber() instanceof JsonTrackingParser.PresentedBigDecimal) {
@ -307,19 +309,19 @@ public class JsonParser extends ParserBase {
try {
n.setXhtml(new XhtmlParser().setValidatorMode(policy == ValidationPolicy.EVERYTHING).parse(n.getValue(), null).getDocumentElement());
} catch (Exception e) {
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing XHTML: "+e.getMessage(), IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_XHTML_, e.getMessage()), IssueSeverity.ERROR);
}
}
if (policy == ValidationPolicy.EVERYTHING) {
// now we cross-check the primitive format against the stated type
if (Utilities.existsInList(n.getType(), "boolean")) {
if (!p.isBoolean())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a boolean", IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_BOOLEAN), IssueSeverity.ERROR);
} else if (Utilities.existsInList(n.getType(), "integer", "unsignedInt", "positiveInt", "decimal")) {
if (!p.isNumber())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a number", IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_NUMBER), IssueSeverity.ERROR);
} else if (!p.isString())
logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a string", IssueSeverity.ERROR);
logError(line(main), col(main), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_STRING), IssueSeverity.ERROR);
}
}
if (fork != null) {
@ -334,12 +336,12 @@ public class JsonParser extends ParserBase {
private void parseResource(String npath, JsonObject res, Element parent, Property elementProperty) throws FHIRException {
JsonElement rt = res.get("resourceType");
if (rt == null) {
logError(line(res), col(res), npath, IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL);
logError(line(res), col(res), npath, IssueType.INVALID, context.formatMessage(I18nConstants.UNABLE_TO_FIND_RESOURCETYPE_PROPERTY), IssueSeverity.FATAL);
} else {
String name = rt.getAsString();
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
if (sd == null)
throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+name+"')");
throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, name));
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
parent.setType(name);
parseChildren(npath, res, parent, true);
@ -379,7 +381,7 @@ public class JsonParser extends ParserBase {
protected void open(String name, String link) throws IOException {
json.link(link);
if (name != null)
if (name != null)
json.name(name);
json.beginObject();
}
@ -390,7 +392,7 @@ public class JsonParser extends ParserBase {
protected void openArray(String name, String link) throws IOException {
json.link(link);
if (name != null)
if (name != null)
json.name(name);
json.beginArray();
}
@ -422,7 +424,7 @@ public class JsonParser extends ParserBase {
public void compose(Element e, JsonCreator json) throws Exception {
this.json = json;
json.beginObject();
prop("resourceType", e.getType(), linkResolver == null ? null : linkResolver.resolveProperty(e.getProperty()));
Set<String> done = new HashSet<String>();
for (Element child : e.getChildren()) {
@ -450,7 +452,7 @@ public class JsonParser extends ParserBase {
if (list.get(0).isPrimitive()) {
boolean prim = false;
complex = false;
for (Element item : list) {
for (Element item : list) {
if (item.hasValue())
prim = true;
if (item.hasChildren())
@ -458,19 +460,19 @@ public class JsonParser extends ParserBase {
}
if (prim) {
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
for (Element item : list) {
for (Element item : list) {
if (item.hasValue())
primitiveValue(null, item);
else
json.nullValue();
}
}
closeArray();
}
name = "_"+name;
}
if (complex) {
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
for (Element item : list) {
for (Element item : list) {
if (item.hasChildren()) {
open(null,null);
if (item.getProperty().isResource()) {
@ -483,9 +485,9 @@ public class JsonParser extends ParserBase {
close();
} else
json.nullValue();
}
}
closeArray();
}
}
}
private void primitiveValue(String name, Element item) throws IOException {
@ -503,10 +505,10 @@ public class JsonParser extends ParserBase {
try {
json.value(new BigDecimal(item.getValue()));
} catch (Exception e) {
throw new NumberFormatException("error writing number '"+item.getValue()+"' to JSON");
throw new NumberFormatException(context.formatMessage(I18nConstants.ERROR_WRITING_NUMBER__TO_JSON, item.getValue()));
}
else
json.value(item.getValue());
json.value(item.getValue());
}
private void compose(String path, Element element) throws IOException {

View File

@ -35,6 +35,7 @@ import org.hl7.fhir.r5.formats.IParser.OutputStyle;
import org.hl7.fhir.r5.model.StructureDefinition;
import org.hl7.fhir.r5.model.StructureDefinition.TypeDerivationRule;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
@ -91,11 +92,11 @@ public abstract class ParserBase {
protected StructureDefinition getDefinition(int line, int col, String ns, String name) throws FHIRFormatError {
if (ns == null) {
logError(line, col, name, IssueType.STRUCTURE, "This '"+name+"' cannot be parsed as a FHIR object (no namespace)", IssueSeverity.FATAL);
logError(line, col, name, IssueType.STRUCTURE, context.formatMessage(I18nConstants.THIS__CANNOT_BE_PARSED_AS_A_FHIR_OBJECT_NO_NAMESPACE, name), IssueSeverity.FATAL);
return null;
}
if (name == null) {
logError(line, col, name, IssueType.STRUCTURE, "This cannot be parsed as a FHIR object (no name)", IssueSeverity.FATAL);
logError(line, col, name, IssueType.STRUCTURE, context.formatMessage(I18nConstants.THIS_CANNOT_BE_PARSED_AS_A_FHIR_OBJECT_NO_NAME), IssueSeverity.FATAL);
return null;
}
for (StructureDefinition sd : context.allStructures()) {
@ -107,13 +108,13 @@ public abstract class ParserBase {
return sd;
}
}
logError(line, col, name, IssueType.STRUCTURE, "This does not appear to be a FHIR resource (unknown namespace/name '"+ns+"::"+name+"')", IssueSeverity.FATAL);
logError(line, col, name, IssueType.STRUCTURE, context.formatMessage(I18nConstants.THIS_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAMESPACENAME_, ns, name), IssueSeverity.FATAL);
return null;
}
protected StructureDefinition getDefinition(int line, int col, String name) throws FHIRFormatError {
if (name == null) {
logError(line, col, name, IssueType.STRUCTURE, "This cannot be parsed as a FHIR object (no name)", IssueSeverity.FATAL);
logError(line, col, name, IssueType.STRUCTURE, context.formatMessage(I18nConstants.THIS_CANNOT_BE_PARSED_AS_A_FHIR_OBJECT_NO_NAME), IssueSeverity.FATAL);
return null;
}
// first pass: only look at base definitions
@ -129,7 +130,7 @@ public abstract class ParserBase {
return sd;
}
}
logError(line, col, name, IssueType.STRUCTURE, "This does not appear to be a FHIR resource (unknown name '"+name+"')", IssueSeverity.FATAL);
logError(line, col, name, IssueType.STRUCTURE, context.formatMessage(I18nConstants.THIS_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, name), IssueSeverity.FATAL);
return null;
}

View File

@ -46,6 +46,7 @@ import org.hl7.fhir.r5.utils.formats.Turtle.TTLList;
import org.hl7.fhir.r5.utils.formats.Turtle.TTLLiteral;
import org.hl7.fhir.r5.utils.formats.Turtle.TTLObject;
import org.hl7.fhir.r5.utils.formats.Turtle.TTLURL;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.TextFile;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
@ -69,7 +70,7 @@ public class TurtleParser extends ParserBase {
try {
src.parse(TextFile.streamToString(input));
} catch (Exception e) {
logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing Turtle: "+e.getMessage(), IssueSeverity.FATAL);
logError(-1, -1, "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_TURTLE_, e.getMessage()), IssueSeverity.FATAL);
return null;
}
return parse(src);
@ -101,7 +102,7 @@ public class TurtleParser extends ParserBase {
private Element parse(Turtle src, TTLComplex cmp) throws FHIRException {
TTLObject type = cmp.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
if (type == null) {
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, "Unknown resource type (missing rdfs:type)", IssueSeverity.FATAL);
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE), IssueSeverity.FATAL);
return null;
}
if (type instanceof TTLList) {
@ -114,7 +115,7 @@ public class TurtleParser extends ParserBase {
}
}
if (!(type instanceof TTLURL)) {
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, "Unexpected datatype for rdfs:type)", IssueSeverity.FATAL);
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.UNEXPECTED_DATATYPE_FOR_RDFSTYPE), IssueSeverity.FATAL);
return null;
}
String name = ((TTLURL) type).getUri();
@ -134,9 +135,9 @@ public class TurtleParser extends ParserBase {
return result;
}
private void parseChildren(Turtle src, String path, TTLComplex object, Element context, boolean primitive) throws FHIRException {
private void parseChildren(Turtle src, String path, TTLComplex object, Element element, boolean primitive) throws FHIRException {
List<Property> properties = context.getProperty().getChildProperties(context.getName(), null);
List<Property> properties = element.getProperty().getChildProperties(element.getName(), null);
Set<String> processed = new HashSet<String>();
if (primitive)
processed.add(FHIR_URI_BASE + "value");
@ -147,10 +148,10 @@ public class TurtleParser extends ParserBase {
if (property.isChoice()) {
for (TypeRefComponent type : property.getDefinition().getType()) {
String eName = property.getName().substring(0, property.getName().length()-3) + Utilities.capitalize(type.getCode());
parseChild(src, object, context, processed, property, path, getFormalName(property, eName));
parseChild(src, object, element, processed, property, path, getFormalName(property, eName));
}
} else {
parseChild(src, object, context, processed, property, path, getFormalName(property));
parseChild(src, object, element, processed, property, path, getFormalName(property));
}
}
@ -159,7 +160,7 @@ public class TurtleParser extends ParserBase {
for (String u : object.getPredicates().keySet()) {
if (!processed.contains(u)) {
TTLObject n = object.getPredicates().get(u);
logError(n.getLine(), n.getCol(), path, IssueType.STRUCTURE, "Unrecognised predicate '"+u+"'", IssueSeverity.ERROR);
logError(n.getLine(), n.getCol(), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNRECOGNISED_PREDICATE_, u), IssueSeverity.ERROR);
}
}
}
@ -181,13 +182,13 @@ public class TurtleParser extends ParserBase {
}
}
private void parseChildInstance(Turtle src, String npath, TTLComplex object, Element context, Property property, String name, TTLObject e) throws FHIRException {
private void parseChildInstance(Turtle src, String npath, TTLComplex object, Element element, Property property, String name, TTLObject e) throws FHIRException {
if (property.isResource())
parseResource(src, npath, object, context, property, name, e);
parseResource(src, npath, object, element, property, name, e);
else if (e instanceof TTLComplex) {
TTLComplex child = (TTLComplex) e;
Element n = new Element(tail(name), property).markLocation(e.getLine(), e.getCol());
context.getChildren().add(n);
element.getChildren().add(n);
if (property.isPrimitive(property.getType(tail(name)))) {
parseChildren(src, npath, child, n, true);
TTLObject val = child.getPredicates().get(FHIR_URI_BASE + "value");
@ -198,13 +199,13 @@ public class TurtleParser extends ParserBase {
// todo: check type
n.setValue(value);
} else
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "This property must be a Literal, not a "+e.getClass().getName(), IssueSeverity.ERROR);
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_A_LITERAL_NOT_A_, e.getClass().getName()), IssueSeverity.ERROR);
}
} else
parseChildren(src, npath, child, n, false);
} else
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "This property must be a URI or bnode, not a "+e.getClass().getName(), IssueSeverity.ERROR);
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_A_URI_OR_BNODE_NOT_A_, e.getClass().getName()), IssueSeverity.ERROR);
}
@ -212,7 +213,7 @@ public class TurtleParser extends ParserBase {
return name.substring(name.lastIndexOf(".")+1);
}
private void parseResource(Turtle src, String npath, TTLComplex object, Element context, Property property, String name, TTLObject e) throws FHIRException {
private void parseResource(Turtle src, String npath, TTLComplex object, Element element, Property property, String name, TTLObject e) throws FHIRException {
TTLComplex obj;
if (e instanceof TTLComplex)
obj = (TTLComplex) e;
@ -220,15 +221,15 @@ public class TurtleParser extends ParserBase {
String url = ((TTLURL) e).getUri();
obj = src.getObject(url);
if (obj == null) {
logError(e.getLine(), e.getCol(), npath, IssueType.INVALID, "reference to "+url+" cannot be resolved", IssueSeverity.FATAL);
logError(e.getLine(), e.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.REFERENCE_TO__CANNOT_BE_RESOLVED, url), IssueSeverity.FATAL);
return;
}
} else
throw new FHIRFormatError("Wrong type for resource");
throw new FHIRFormatError(context.formatMessage(I18nConstants.WRONG_TYPE_FOR_RESOURCE));
TTLObject type = obj.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
if (type == null) {
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "Unknown resource type (missing rdfs:type)", IssueSeverity.FATAL);
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE), IssueSeverity.FATAL);
return;
}
if (type instanceof TTLList) {
@ -241,7 +242,7 @@ public class TurtleParser extends ParserBase {
}
}
if (!(type instanceof TTLURL)) {
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "Unexpected datatype for rdfs:type)", IssueSeverity.FATAL);
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.UNEXPECTED_DATATYPE_FOR_RDFSTYPE), IssueSeverity.FATAL);
return;
}
String rt = ((TTLURL) type).getUri();
@ -253,7 +254,7 @@ public class TurtleParser extends ParserBase {
return;
Element n = new Element(tail(name), property).markLocation(object.getLine(), object.getCol());
context.getChildren().add(n);
element.getChildren().add(n);
n.updateProperty(new Property(this.context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(n.getProperty()), property);
n.setType(rt);
parseChildren(src, npath, obj, n, false);
@ -278,7 +279,7 @@ public class TurtleParser extends ParserBase {
if (en == null)
en = property.getDefinition().getPath();
if (!en.endsWith("[x]"))
throw new Error("Attempt to replace element name for a non-choice type");
throw new Error(context.formatMessage(I18nConstants.ATTEMPT_TO_REPLACE_ELEMENT_NAME_FOR_A_NONCHOICE_TYPE));
return en.substring(0, en.lastIndexOf(".")+1)+elementName;
}

View File

@ -54,6 +54,7 @@ import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.r5.utils.formats.XmlLocationAnnotator;
import org.hl7.fhir.r5.utils.formats.XmlLocationData;
import org.hl7.fhir.utilities.ElementDecoration;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
@ -140,7 +141,8 @@ public class XmlParser extends ParserBase {
Node node = document.getFirstChild();
while (node != null) {
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE)
logError(line(document), col(document), "(document)", IssueType.INVALID, "No processing instructions allowed in resources", IssueSeverity.ERROR);
logError(line(document), col(document), "(document)", IssueType.INVALID, context.formatMessage(
I18nConstants.NO_PROCESSING_INSTRUCTIONS_ALLOWED_IN_RESOURCES), IssueSeverity.ERROR);
node = node.getNextSibling();
}
}
@ -214,14 +216,14 @@ public class XmlParser extends ParserBase {
private void checkElement(org.w3c.dom.Element element, String path, Property prop) throws FHIRFormatError {
if (policy == ValidationPolicy.EVERYTHING) {
if (empty(element) && FormatUtilities.FHIR_NS.equals(element.getNamespaceURI())) // this rule only applies to FHIR Content
logError(line(element), col(element), path, IssueType.INVALID, "Element must have some content", IssueSeverity.ERROR);
logError(line(element), col(element), path, IssueType.INVALID, context.formatMessage(I18nConstants.ELEMENT_MUST_HAVE_SOME_CONTENT), IssueSeverity.ERROR);
String ns = FormatUtilities.FHIR_NS;
if (ToolingExtensions.hasExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
ns = ToolingExtensions.readStringExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
else if (ToolingExtensions.hasExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
ns = ToolingExtensions.readStringExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
if (!element.getNamespaceURI().equals(ns))
logError(line(element), col(element), path, IssueType.INVALID, "Wrong namespace - expected '"+ns+"'", IssueSeverity.ERROR);
logError(line(element), col(element), path, IssueType.INVALID, context.formatMessage(I18nConstants.WRONG_NAMESPACE__EXPECTED_, ns), IssueSeverity.ERROR);
}
}
@ -236,10 +238,10 @@ public class XmlParser extends ParserBase {
return result;
}
private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws FHIRFormatError, FHIRException, IOException, DefinitionException {
private void parseChildren(String path, org.w3c.dom.Element node, Element element) throws FHIRFormatError, FHIRException, IOException, DefinitionException {
// this parsing routine retains the original order in a the XML file, to support validation
reapComments(node, context);
List<Property> properties = context.getProperty().getChildProperties(context.getName(), XMLUtil.getXsiType(node));
reapComments(node, element);
List<Property> properties = element.getProperty().getChildProperties(element.getName(), XMLUtil.getXsiType(node));
String text = XMLUtil.getDirectText(node).trim();
if (!Utilities.noString(text)) {
@ -247,17 +249,17 @@ public class XmlParser extends ParserBase {
if (property != null) {
if ("ED.data[x]".equals(property.getDefinition().getId()) || (property.getDefinition()!=null && property.getDefinition().getBase()!=null && "ED.data[x]".equals(property.getDefinition().getBase().getPath()))) {
if ("B64".equals(node.getAttribute("representation"))) {
context.getChildren().add(new Element("dataBase64Binary", property, "base64Binary", text).markLocation(line(node), col(node)));
element.getChildren().add(new Element("dataBase64Binary", property, "base64Binary", text).markLocation(line(node), col(node)));
} else {
context.getChildren().add(new Element("dataString", property, "string", text).markLocation(line(node), col(node)));
element.getChildren().add(new Element("dataString", property, "string", text).markLocation(line(node), col(node)));
}
} else {
context.getChildren().add(
element.getChildren().add(
new Element(property.getName(), property, property.getType(), text).markLocation(line(node), col(node)));
}
}
else {
logError(line(node), col(node), path, IssueType.STRUCTURE, "Text should not be present", IssueSeverity.ERROR);
logError(line(node), col(node), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.TEXT_SHOULD_NOT_BE_PRESENT), IssueSeverity.ERROR);
}
}
@ -269,10 +271,10 @@ public class XmlParser extends ParserBase {
String av = attr.getNodeValue();
if (ToolingExtensions.hasExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"))
av = convertForDateFormatFromExternal(ToolingExtensions.readStringExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"), av);
if (property.getName().equals("value") && context.isPrimitive())
context.setValue(av);
if (property.getName().equals("value") && element.isPrimitive())
element.setValue(av);
else
context.getChildren().add(new Element(property.getName(), property, property.getType(), av).markLocation(line(node), col(node)));
element.getChildren().add(new Element(property.getName(), property, property.getType(), av).markLocation(line(node), col(node)));
} else {
boolean ok = false;
if (FormatUtilities.FHIR_NS.equals(node.getNamespaceURI())) {
@ -281,9 +283,9 @@ public class XmlParser extends ParserBase {
}
} else
ok = ok || (attr.getLocalName().equals("schemaLocation")); // xsi:schemalocation allowed for non FHIR content
ok = ok || (hasTypeAttr(context) && attr.getLocalName().equals("type") && FormatUtilities.NS_XSI.equals(attr.getNamespaceURI())); // xsi:type allowed if element says so
ok = ok || (hasTypeAttr(element) && attr.getLocalName().equals("type") && FormatUtilities.NS_XSI.equals(attr.getNamespaceURI())); // xsi:type allowed if element says so
if (!ok)
logError(line(node), col(node), path, IssueType.STRUCTURE, "Undefined attribute '@"+attr.getNodeName()+"' on "+node.getNodeName()+" for type "+context.fhirType()+" (properties = "+properties+")", IssueSeverity.ERROR);
logError(line(node), col(node), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNDEFINED_ATTRIBUTE__ON__FOR_TYPE__PROPERTIES__, attr.getNodeName(), node.getNodeName(), element.fhirType(), properties), IssueSeverity.ERROR);
}
}
}
@ -295,11 +297,11 @@ public class XmlParser extends ParserBase {
if (property != null) {
if (!property.isChoice() && "xhtml".equals(property.getType())) {
XhtmlNode xhtml;
if (property.getDefinition().hasRepresentation(PropertyRepresentation.CDATEXT))
if (property.getDefinition().hasRepresentation(PropertyRepresentation.CDATEXT))
xhtml = new CDANarrativeFormat().convert((org.w3c.dom.Element) child);
else
xhtml = new XhtmlParser().setValidatorMode(true).parseHtmlNode((org.w3c.dom.Element) child);
context.getChildren().add(new Element(property.getName(), property, "xhtml", new XhtmlComposer(XhtmlComposer.XML, false).compose(xhtml)).setXhtml(xhtml).markLocation(line(child), col(child)));
element.getChildren().add(new Element(property.getName(), property, "xhtml", new XhtmlComposer(XhtmlComposer.XML, false).compose(xhtml)).setXhtml(xhtml).markLocation(line(child), col(child)));
} else {
String npath = path+"/"+pathPrefix(child.getNamespaceURI())+child.getLocalName();
Element n = new Element(child.getLocalName(), property).markLocation(line(child), col(child));
@ -313,7 +315,7 @@ public class XmlParser extends ParserBase {
xsiType = ToolingExtensions.readStringExtension(property.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype");
n.setType(xsiType);
} else {
logError(line(child), col(child), path, IssueType.STRUCTURE, "No type found on '"+child.getLocalName()+'"', IssueSeverity.ERROR);
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.NO_TYPE_FOUND_ON_, child.getLocalName()), IssueSeverity.ERROR);
ok = false;
}
} else {
@ -325,7 +327,7 @@ public class XmlParser extends ParserBase {
} else
n.setType(n.getType());
}
context.getChildren().add(n);
element.getChildren().add(n);
if (ok) {
if (property.isResource())
parseResource(npath, (org.w3c.dom.Element) child, n, property);
@ -334,11 +336,11 @@ public class XmlParser extends ParserBase {
}
}
} else
logError(line(child), col(child), path, IssueType.STRUCTURE, "Undefined element '"+child.getLocalName()+"'", IssueSeverity.ERROR);
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNDEFINED_ELEMENT_, child.getLocalName()), IssueSeverity.ERROR);
} else if (child.getNodeType() == Node.CDATA_SECTION_NODE){
logError(line(child), col(child), path, IssueType.STRUCTURE, "CDATA is not allowed", IssueSeverity.ERROR);
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.CDATA_IS_NOT_ALLOWED), IssueSeverity.ERROR);
} else if (!Utilities.existsInList(child.getNodeType(), 3, 8)) {
logError(line(child), col(child), path, IssueType.STRUCTURE, "Node type "+Integer.toString(child.getNodeType())+" is not allowed", IssueSeverity.ERROR);
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.NODE_TYPE__IS_NOT_ALLOWED, Integer.toString(child.getNodeType())), IssueSeverity.ERROR);
}
child = child.getNextSibling();
}
@ -355,7 +357,8 @@ public class XmlParser extends ParserBase {
}
});
for (Property p : propsSortedByLongestFirst)
if (!p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR) && !p.getDefinition().hasRepresentation(PropertyRepresentation.XMLTEXT)) {
if (!p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR) && !p.getDefinition().hasRepresentation(
PropertyRepresentation.XMLTEXT)) {
if (p.getName().equals(nodeName))
return p;
if (p.getName().endsWith("[x]") && nodeName.length() > p.getName().length()-3 && p.getName().substring(0, p.getName().length()-3).equals(nodeName.substring(0, p.getName().length()-3)))
@ -366,7 +369,8 @@ public class XmlParser extends ParserBase {
private Property getAttrProp(List<Property> properties, String nodeName) {
for (Property p : properties)
if (p.getName().equals(nodeName) && p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR))
if (p.getName().equals(nodeName) && p.getDefinition().hasRepresentation(
PropertyRepresentation.XMLATTR))
return p;
return null;
}
@ -383,7 +387,7 @@ public class XmlParser extends ParserBase {
DateTimeType d = DateTimeType.parseV3(av);
return d.asStringValue();
} else
throw new FHIRException("Unknown Data format '"+fmt+"'");
throw new FHIRException(context.formatMessage(I18nConstants.UNKNOWN_DATA_FORMAT_, fmt));
}
private String convertForDateFormatToExternal(String fmt, String av) throws FHIRException {
@ -391,7 +395,7 @@ public class XmlParser extends ParserBase {
DateTimeType d = new DateTimeType(av);
return d.getAsV3();
} else
throw new FHIRException("Unknown Date format '"+fmt+"'");
throw new FHIRException(context.formatMessage(I18nConstants.UNKNOWN_DATE_FORMAT_, fmt));
}
private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
@ -399,7 +403,7 @@ public class XmlParser extends ParserBase {
String name = res.getLocalName();
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
if (sd == null)
throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+res.getLocalName()+"')");
throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, res.getLocalName()));
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
parent.setType(name);
parseChildren(res.getLocalName(), res, parent);

View File

@ -9,9 +9,9 @@ package org.hl7.fhir.r5.terminologies;
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -45,6 +45,7 @@ import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent;
import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent;
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.validation.ValidationOptions;
import org.hl7.fhir.utilities.validation.ValidationOptions.ValueSetMode;
@ -70,7 +71,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
if (options.getValueSetMode() != ValueSetMode.CHECK_MEMERSHIP_ONLY) {
for (Coding c : code.getCoding()) {
if (!c.hasSystem())
warnings.add("Coding has no system - cannot validate");
warnings.add(context.formatMessage(I18nConstants.CODING_HAS_NO_SYSTEM__CANNOT_VALIDATE));
CodeSystem cs = context.fetchCodeSystem(c.getSystem());
ValidationResult res = null;
if (cs == null || cs.getContent() != CodeSystemContentMode.COMPLETE) {
@ -90,7 +91,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
ok = ok || codeInValueSet(c.getSystem(), c.getCode());
}
if (!ok)
errors.add(0, "None of the provided codes are in the value set "+valueset.getUrl());
errors.add(0, context.formatMessage(I18nConstants.NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_, valueset.getUrl()));
}
if (errors.size() > 0)
return new ValidationResult(IssueSeverity.ERROR, errors.toString());
@ -138,7 +139,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
if (!inExpansion)
res.setMessage("Not in value set "+valueset.getUrl()).setSeverity(IssueSeverity.ERROR);
else if (warningMessage!=null)
res = new ValidationResult(IssueSeverity.WARNING, "Code found in expansion, however: " + warningMessage);
res = new ValidationResult(IssueSeverity.WARNING, context.formatMessage(I18nConstants.CODE_FOUND_IN_EXPANSION_HOWEVER_, warningMessage));
else
res.setMessage("Code found in expansion, however: " + res.getMessage());
}
@ -165,7 +166,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
private ValidationResult validateCode(Coding code, CodeSystem cs) {
ConceptDefinitionComponent cc = findCodeInConcept(cs.getConcept(), code.getCode());
if (cc == null)
return new ValidationResult(IssueSeverity.ERROR, "Unknown Code "+gen(code)+" in "+cs.getUrl());
return new ValidationResult(IssueSeverity.ERROR, context.formatMessage(I18nConstants.UNKNOWN_CODE__IN_, gen(code), cs.getUrl()));
if (code.getDisplay() == null)
return new ValidationResult(cc);
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder();
@ -193,7 +194,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
return new ValidationResult(cc);
}
}
return new ValidationResult(IssueSeverity.WARNING, "Display Name for "+code.getSystem()+"#"+code.getCode()+" should be one of '"+b.toString()+"' instead of '"+code.getDisplay()+"'", cc);
return new ValidationResult(IssueSeverity.WARNING, context.formatMessage(I18nConstants.DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF_, code.getSystem(), code.getCode(), b.toString(), code.getDisplay()), cc);
}
private ConceptReferenceComponent findValueSetRef(String system, String code) {
@ -233,25 +234,25 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
private String getValueSetSystem() throws FHIRException {
if (valueset == null)
throw new FHIRException("Unable to resolve system - no value set");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__NO_VALUE_SET));
if (valueset.getCompose().hasExclude())
throw new FHIRException("Unable to resolve system - value set has excludes");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_EXCLUDES));
if (valueset.getCompose().getInclude().size() == 0) {
if (!valueset.hasExpansion() || valueset.getExpansion().getContains().size() == 0)
throw new FHIRException("Unable to resolve system - value set has no includes or expansion");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_INCLUDES_OR_EXPANSION));
else {
String cs = valueset.getExpansion().getContains().get(0).getSystem();
if (cs != null && checkSystem(valueset.getExpansion().getContains(), cs))
return cs;
else
throw new FHIRException("Unable to resolve system - value set expansion has multiple systems");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_EXPANSION_HAS_MULTIPLE_SYSTEMS));
}
}
for (ConceptSetComponent inc : valueset.getCompose().getInclude()) {
if (inc.hasValueSet())
throw new FHIRException("Unable to resolve system - value set has imports");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_IMPORTS));
if (!inc.hasSystem())
throw new FHIRException("Unable to resolve system - value set has include with no system");
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_NO_SYSTEM));
}
if (valueset.getCompose().getInclude().size() == 1)
return valueset.getCompose().getInclude().get(0).getSystem();
@ -360,7 +361,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
// ok, we need the code system
CodeSystem cs = context.fetchCodeSystem(system);
if (cs == null || cs.getContent() != CodeSystemContentMode.COMPLETE) {
// make up a transient value set with
// make up a transient value set with
ValueSet vs = new ValueSet();
vs.setUrl(Utilities.makeUuidUrn());
vs.getCompose().addInclude(vsi);
@ -395,7 +396,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
return codeInConceptFilter(cs, f, code);
else {
System.out.println("todo: handle filters with property = "+f.getProperty());
throw new FHIRException("Unable to handle system "+cs.getUrl()+" filter with property = "+f.getProperty());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_HANDLE_SYSTEM__FILTER_WITH_PROPERTY__, cs.getUrl(), f.getProperty()));
}
}
@ -405,7 +406,7 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
case ISNOTA: return !codeInConceptIsAFilter(cs, f, code);
default:
System.out.println("todo: handle concept filters with op = "+f.getOp());
throw new FHIRException("Unable to handle system "+cs.getUrl()+" concept filter with op = "+f.getOp());
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_HANDLE_SYSTEM__CONCEPT_FILTER_WITH_OP__, cs.getUrl(), f.getOp()));
}
}

View File

@ -143,9 +143,10 @@ public interface IResourceValidator {
public boolean isShowMessagesFromReferences();
public void setShowMessagesFromReferences(boolean value);
public String getValidationLanguage();
public void setValidationLanguage(String value);
//FIXME: don't need that, gets never used?
// public String getValidationLanguage();
// public void setValidationLanguage(String value);
/**
* It's common to see references such as Patient/234234 - these usually mean a reference to a Patient resource.

View File

@ -1,4 +1,7 @@
package org.hl7.fhir.validation.utils;
package org.hl7.fhir.utilities;
import java.text.MessageFormat;
import java.util.ResourceBundle;
public class I18nConstants {
@ -268,5 +271,163 @@ public class I18nConstants {
public final static String NOT_DONE_YET_VALIDATORHOSTSERVICESEXECUTEFUNCTION = "Not_done_yet_ValidatorHostServicesexecuteFunction";
public final static String NOT_DONE_YET_VALIDATORHOSTSERVICESCHECKFUNCTION = "Not_done_yet_ValidatorHostServicescheckFunction";
public final static String NOT_DONE_YET_VALIDATORHOSTSERVICESRESOLVEFUNCTION_ = "Not_done_yet_ValidatorHostServicesresolveFunction_";
public final static String UNABLE_TO_FIND_BASE_DEFINITION_FOR_LOGICAL_MODEL__FROM_ = "Unable_to_find_base_definition_for_logical_model__from_";
public final static String SAME_ID_ON_MULTIPLE_ELEMENTS__IN_ = "Same_id_on_multiple_elements__in_";
public final static String NO_PATH_ON_ELEMENT_DEFINITION__IN_ = "No_path_on_element_Definition__in_";
public final static String NEEDS_A_SNAPSHOT = "needs_a_snapshot";
public final static String NOT_THE_RIGHT_KIND_OF_STRUCTURE_TO_GENERATE_SCHEMATRONS_FOR = "not_the_right_kind_of_structure_to_generate_schematrons_for";
public final static String NOT_HANDLED_YET_SORTELEMENTS_ = "Not_handled_yet_sortElements_";
public final static String UNABLE_TO_RESOLVE_PROFILE__IN_ELEMENT_ = "Unable_to_resolve_profile__in_element_";
public final static String CANT_HAVE_CHILDREN_ON_AN_ELEMENT_WITH_A_POLYMORPHIC_TYPE__YOU_MUST_SLICE_AND_CONSTRAIN_THE_TYPES_FIRST_SORTELEMENTS_ = "Cant_have_children_on_an_element_with_a_polymorphic_type__you_must_slice_and_constrain_the_types_first_sortElements_";
public final static String UNABLE_TO_FIND_PROFILE__AT_ = "Unable_to_find_profile__at_";
public final static String UNHANDLED_SITUATION_RESOURCE_IS_PROFILED_TO_MORE_THAN_ONE_OPTION__CANNOT_SORT_PROFILE = "Unhandled_situation_resource_is_profiled_to_more_than_one_option__cannot_sort_profile";
public final static String INTERNAL_RECURSION_DETECTION_FIND_LOOP_PATH_RECURSION____CHECK_PATHS_ARE_VALID_FOR_PATH_ = "Internal_recursion_detection_find_loop_path_recursion____check_paths_are_valid_for_path_";
public final static String INTERNAL_ERROR___TYPE_NOT_KNOWN_ = "Internal_error___type_not_known_";
public final static String UNABLE_TO_FIND_ELEMENT_ = "Unable_to_find_element_";
public final static String ERROR_GENERATING_TABLE_FOR_PROFILE__ = "Error_generating_table_for_profile__";
public final static String STRUCTUREDEFINITION__AT__ILLEGAL_CONSTRAINED_TYPE__FROM__IN_ = "StructureDefinition__at__illegal_constrained_type__from__in_";
public final static String ERROR_AT__THE_TARGET_PROFILE__IS_NOT__VALID_CONSTRAINT_ON_THE_BASE_ = "Error_at__The_target_profile__is_not__valid_constraint_on_the_base_";
public final static String ERROR_IN_PROFILE__AT__BASE_ISSUMMARY___DERIVED_ISSUMMARY__ = "Error_in_profile__at__Base_isSummary___derived_isSummary__";
public final static String UNEXPECTED_CONDITION_IN_DIFFERENTIAL_TYPESLICETYPELISTSIZE__1_AT_ = "Unexpected_condition_in_differential_typeslicetypelistsize__1_at_";
public final static String UNEXPECTED_CONDITION_IN_DIFFERENTIAL_TYPESLICETYPELISTSIZE__10_AND_IMPLICIT_SLICE_NAME_DOES_NOT_CONTAIN_A_VALID_TYPE__AT_ = "Unexpected_condition_in_differential_typeslicetypelistsize__10_and_implicit_slice_name_does_not_contain_a_valid_type__at_";
public final static String ATTEMPT_TO_USE_A_SNAPSHOT_ON_PROFILE__AS__BEFORE_IT_IS_GENERATED = "Attempt_to_use_a_snapshot_on_profile__as__before_it_is_generated";
public final static String NULL_MIN = "null_min";
public final static String _HAS_CHILDREN__FOR_TYPE__IN_PROFILE__BUT_CANT_FIND_TYPE = "_has_children__for_type__in_profile__but_cant_find_type";
public final static String _HAS_CHILDREN__AND_MULTIPLE_TYPES__IN_PROFILE_ = "_has_children__and_multiple_types__in_profile_";
public final static String ADDING_WRONG_PATH = "Adding_wrong_path";
public final static String NAMED_ITEMS_ARE_OUT_OF_ORDER_IN_THE_SLICE = "Named_items_are_out_of_order_in_the_slice";
public final static String THE_BASE_SNAPSHOT_MARKS_A_SLICING_AS_CLOSED_BUT_THE_DIFFERENTIAL_TRIES_TO_EXTEND_IT_IN__AT__ = "The_base_snapshot_marks_a_slicing_as_closed_but_the_differential_tries_to_extend_it_in__at__";
public final static String NOT_DONE_YET = "Not_done_yet";
public final static String UNKNOWN_TYPE__AT_ = "Unknown_type__at_";
public final static String DIFFERENTIAL_WALKS_INTO____BUT_THE_BASE_DOES_NOT_AND_THERE_IS_NOT_A_SINGLE_FIXED_TYPE_THE_TYPE_IS__THIS_IS_NOT_HANDLED_YET = "Differential_walks_into____but_the_base_does_not_and_there_is_not_a_single_fixed_type_The_type_is__This_is_not_handled_yet";
public final static String SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___RULE___ = "Slicing_rules_on_differential__do_not_match_those_on_base___rule___";
public final static String SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___DISCIMINATOR___ = "Slicing_rules_on_differential__do_not_match_those_on_base___disciminator___";
public final static String SLICING_RULES_ON_DIFFERENTIAL__DO_NOT_MATCH_THOSE_ON_BASE___ORDER___ = "Slicing_rules_on_differential__do_not_match_those_on_base___order___";
public final static String INVALID_SLICING__THERE_IS_MORE_THAN_ONE_TYPE_SLICE_AT__BUT_ONE_OF_THEM__HAS_MIN__1_SO_THE_OTHER_SLICES_CANNOT_EXIST = "Invalid_slicing__there_is_more_than_one_type_slice_at__but_one_of_them__has_min__1_so_the_other_slices_cannot_exist";
public final static String DID_NOT_FIND_TYPE_ROOT_ = "Did_not_find_type_root_";
public final static String ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_WRONG_TYPE_ = "Error_at_path__Slice_for_type__has_wrong_type_";
public final static String ERROR_AT_PATH__SLICE_FOR_TYPE__HAS_MORE_THAN_ONE_TYPE_ = "Error_at_path__Slice_for_type__has_more_than_one_type_";
public final static String ERROR_AT_PATH__SLICE_NAME_MUST_BE__BUT_IS_ = "Error_at_path__Slice_name_must_be__but_is_";
public final static String ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORPATH__THIS = "Error_at_path__in__Type_slicing_with_slicingdiscriminatorpath__this";
public final static String ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORTYPE__TYPE = "Error_at_path__in__Type_slicing_with_slicingdiscriminatortype__type";
public final static String ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGDISCRIMINATORCOUNT__1 = "Error_at_path__in__Type_slicing_with_slicingdiscriminatorcount__1";
public final static String ERROR_AT_PATH__IN__TYPE_SLICING_WITH_SLICINGORDERED__TRUE = "Error_at_path__in__Type_slicing_with_slicingordered__true";
public final static String ADDING_WRONG_PATH_IN_PROFILE___VS_ = "Adding_wrong_path_in_profile___vs_";
public final static String _HAS_NO_CHILDREN__AND_NO_TYPES_IN_PROFILE_ = "_has_no_children__and_no_types_in_profile_";
public final static String DID_NOT_FIND_SINGLE_SLICE_ = "Did_not_find_single_slice_";
public final static String DIFFERENTIAL_DOES_NOT_HAVE_A_SLICE__B_OF_____IN_PROFILE_ = "Differential_does_not_have_a_slice__b_of_____in_profile_";
public final static String ATTEMPT_TO_A_SLICE_AN_ELEMENT_THAT_DOES_NOT_REPEAT__FROM__IN_ = "Attempt_to_a_slice_an_element_that_does_not_repeat__from__in_";
public final static String UNABLE_TO_RESOLVE_REFERENCE_TO_ = "Unable_to_resolve_reference_to_";
public final static String UNABLE_TO_FIND_ELEMENT__IN_ = "Unable_to_find_element__in_";
public final static String UNABLE_TO_FIND_BASE__FOR_ = "Unable_to_find_base__for_";
public final static String ADDING_WRONG_PATH__OUTCOMEGETPATH___RESULTPATHBASE__ = "Adding_wrong_path__outcomegetPath___resultPathBase__";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__ILLEGAL_CHARACTERS_ = "Illegal_path__in_differential_in__illegal_characters_";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__ILLEGAL_CHARACTER_ = "Illegal_path__in_differential_in__illegal_character_";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NO_UNICODE_WHITESPACE = "Illegal_path__in_differential_in__no_unicode_whitespace";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NAME_PORTION_EXCEEDS_64_CHARS_IN_LENGTH = "Illegal_path__in_differential_in__name_portion_exceeds_64_chars_in_length";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__NAME_PORTION_MISING_ = "Illegal_path__in_differential_in__name_portion_mising_";
public final static String ILLEGAL_PATH__IN_DIFFERENTIAL_IN__MUST_START_WITH_ = "Illegal_path__in_differential_in__must_start_with_";
public final static String NO_PATH_VALUE_ON_ELEMENT_IN_DIFFERENTIAL_IN_ = "No_path_value_on_element_in_differential_in_";
public final static String NO_PATH_ON_ELEMENT_IN_DIFFERENTIAL_IN_ = "No_path_on_element_in_differential_in_";
public final static String UNXPECTED_INTERNAL_CONDITION__NO_SOURCE_ON_DIFF_ELEMENT = "Unxpected_internal_condition__no_source_on_diff_element";
public final static String TYPE_ON_FIRST_SNAPSHOT_ELEMENT_FOR__IN__FROM_ = "type_on_first_snapshot_element_for__in__from_";
public final static String TYPE_ON_FIRST_DIFFERENTIAL_ELEMENT = "type_on_first_differential_element";
public final static String CIRCULAR_SNAPSHOT_REFERENCES_DETECTED_CANNOT_GENERATE_SNAPSHOT_STACK__ = "Circular_snapshot_references_detected_cannot_generate_snapshot_stack__";
public final static String BASE__DERIVED_PROFILES_HAVE_DIFFERENT_TYPES____VS___ = "Base__Derived_profiles_have_different_types____vs___";
public final static String DERIVED_PROFILE__HAS_NO_DERIVATION_VALUE_AND_SO_CANT_BE_PROCESSED = "Derived_profile__has_no_derivation_value_and_so_cant_be_processed";
public final static String DERIVED_PROFILE__HAS_NO_TYPE = "Derived_profile__has_no_type";
public final static String BASE_PROFILE__HAS_NO_TYPE = "Base_profile__has_no_type";
public final static String NO_DERIVED_STRUCTURE_PROVIDED = "no_derived_structure_provided";
public final static String NO_BASE_PROFILE_PROVIDED = "no_base_profile_provided";
public final static String ELEMENT_ID__NULL__ON_ = "element_id__null__on_";
public final static String ELEMENT__NULL_ = "element__null_";
public final static String GETSLICELIST_SHOULD_ONLY_BE_CALLED_WHEN_THE_ELEMENT_HAS_SLICING = "getSliceList_should_only_be_called_when_the_element_has_slicing";
public final static String UNABLE_TO_RESOLVE_NAME_REFERENCE__AT_PATH_ = "Unable_to_resolve_name_reference__at_path_";
public final static String DETAILS_FOR__MATCHING_AGAINST_PROFILE_ = "Details_for__matching_against_Profile_";
public final static String DOES_NOT_MATCH_SLICE_ = "Does_not_match_slice_";
public final static String PROFILE__DOES_NOT_MATCH_FOR__BECAUSE_OF_THE_FOLLOWING_PROFILE_ISSUES__ = "Profile__does_not_match_for__because_of_the_following_profile_issues__";
public final static String THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_ = "This_element_does_not_match_any_known_slice_";
public final static String DEFINED_IN_THE_PROFILE = "defined_in_the_profile";
public final static String THIS_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_ = "This_does_not_appear_to_be_a_FHIR_resource_unknown_name_";
public final static String THIS_CANNOT_BE_PARSED_AS_A_FHIR_OBJECT_NO_NAME = "This_cannot_be_parsed_as_a_FHIR_object_no_name";
public final static String THIS_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAMESPACENAME_ = "This_does_not_appear_to_be_a_FHIR_resource_unknown_namespacename_";
public final static String THIS__CANNOT_BE_PARSED_AS_A_FHIR_OBJECT_NO_NAMESPACE = "This__cannot_be_parsed_as_a_FHIR_object_no_namespace";
public final static String UNABLE_TO_FIND_RESOURCETYPE_PROPERTY = "Unable_to_find_resourceType_property";
public final static String ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_STRING = "Error_parsing_JSON_the_primitive_value_must_be_a_string";
public final static String ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_NUMBER = "Error_parsing_JSON_the_primitive_value_must_be_a_number";
public final static String ERROR_PARSING_JSON_THE_PRIMITIVE_VALUE_MUST_BE_A_BOOLEAN = "Error_parsing_JSON_the_primitive_value_must_be_a_boolean";
public final static String ERROR_PARSING_XHTML_ = "Error_parsing_XHTML_";
public final static String THIS_PROPERTY_MUST_BE_AN_OBJECT_NOT_ = "This_property_must_be_an_object_not_";
public final static String THIS_PROPERTY_MUST_BE_AN_SIMPLE_VALUE_NOT_ = "This_property_must_be_an_simple_value_not_";
public final static String THIS_PROPERTY_MUST_BE__NOT_ = "This_property_must_be__not_";
public final static String THIS_PROPERTY_MUST_BE_AN_ARRAY_NOT_ = "This_property_must_be_an_Array_not_";
public final static String UNRECOGNISED_PROPERTY_ = "Unrecognised_property_";
public final static String OBJECT_MUST_HAVE_SOME_CONTENT = "Object_must_have_some_content";
public final static String ERROR_PARSING_JSON_ = "Error_parsing_JSON_";
public final static String NODE_TYPE__IS_NOT_ALLOWED = "Node_type__is_not_allowed";
public final static String CDATA_IS_NOT_ALLOWED = "CDATA_is_not_allowed";
public final static String UNDEFINED_ELEMENT_ = "Undefined_element_";
public final static String UNDEFINED_ATTRIBUTE__ON__FOR_TYPE__PROPERTIES__ = "Undefined_attribute__on__for_type__properties__";
public final static String TEXT_SHOULD_NOT_BE_PRESENT = "Text_should_not_be_present";
public final static String WRONG_NAMESPACE__EXPECTED_ = "Wrong_namespace__expected_";
public final static String ELEMENT_MUST_HAVE_SOME_CONTENT = "Element_must_have_some_content";
public final static String NO_PROCESSING_INSTRUCTIONS_ALLOWED_IN_RESOURCES = "No_processing_instructions_allowed_in_resources";
public final static String UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE = "Unknown_resource_type_missing_rdfstype";
public final static String REFERENCE_TO__CANNOT_BE_RESOLVED = "reference_to__cannot_be_resolved";
public final static String THIS_PROPERTY_MUST_BE_A_URI_OR_BNODE_NOT_A_ = "This_property_must_be_a_URI_or_bnode_not_a_";
public final static String THIS_PROPERTY_MUST_BE_A_LITERAL_NOT_A_ = "This_property_must_be_a_Literal_not_a_";
public final static String UNRECOGNISED_PREDICATE_ = "Unrecognised_predicate_";
public final static String ERROR_PARSING_TURTLE_ = "Error_parsing_Turtle_";
public final static String UNEXPECTED_DATATYPE_FOR_RDFSTYPE = "Unexpected_datatype_for_rdfstype";
public final static String ATTEMPT_TO_REPLACE_ELEMENT_NAME_FOR_A_NONCHOICE_TYPE = "Attempt_to_replace_element_name_for_a_nonchoice_type";
public final static String WRONG_TYPE_FOR_RESOURCE = "Wrong_type_for_resource";
public final static String CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_ = "Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_";
public final static String UNKNOWN_DATE_FORMAT_ = "Unknown_Date_format_";
public final static String UNKNOWN_DATA_FORMAT_ = "Unknown_Data_format_";
public final static String NO_TYPE_FOUND_ON_ = "No_type_found_on_";
public final static String ERROR_WRITING_NUMBER__TO_JSON = "error_writing_number__to_JSON";
public final static String UNABLE_TO_PROCESS_REQUEST_FOR_RESOURCE_FOR___ = "Unable_to_process_request_for_resource_for___";
public final static String RESOURCE_TYPE_MISMATCH_FOR___ = "Resource_type_mismatch_for___";
public final static String NOT_DONE_YET_CANT_FETCH_ = "not_done_yet_cant_fetch_";
public final static String ATTEMPT_TO_USE_TERMINOLOGY_SERVER_WHEN_NO_TERMINOLOGY_SERVER_IS_AVAILABLE = "Attempt_to_use_Terminology_server_when_no_Terminology_server_is_available";
public final static String NO_EXPANSIONPROFILE_PROVIDED = "No_ExpansionProfile_provided";
public final static String CAN_ONLY_SPECIFY_PROFILE_IN_THE_CONTEXT = "Can_only_specify_profile_in_the_context";
public final static String NO_URL_IN_EXPAND_VALUE_SET_2 = "no_url_in_expand_value_set_2";
public final static String NO_URL_IN_EXPAND_VALUE_SET = "no_url_in_expand_value_set";
public final static String NO_VALUE_SET = "no_value_set";
public final static String NO_PARAMETERS_PROVIDED_TO_EXPANDVS = "No_Parameters_provided_to_expandVS";
public final static String NO_EXPANSION_PARAMETERS_PROVIDED = "No_Expansion_Parameters_provided";
public final static String UNABLE_TO_RESOLVE_VALUE_SET_ = "Unable_to_resolve_value_Set_";
public final static String DELIMITED_VERSIONS_HAVE_EXACT_MATCH_FOR_DELIMITER____VS_ = "Delimited_versions_have_exact_match_for_delimiter____vs_";
public final static String DUPLICATE_RESOURCE_ = "Duplicate_Resource_";
public final static String ERROR_EXPANDING_VALUESET_RUNNING_WITHOUT_TERMINOLOGY_SERVICES = "Error_expanding_ValueSet_running_without_terminology_services";
public final static String ERROR_VALIDATING_CODE_RUNNING_WITHOUT_TERMINOLOGY_SERVICES = "Error_validating_code_running_without_terminology_services";
public final static String UNABLE_TO_VALIDATE_CODE_WITHOUT_USING_SERVER = "Unable_to_validate_code_without_using_server";
public final static String PROFILE___ERROR_GENERATING_SNAPSHOT = "Profile___Error_generating_snapshot";
public final static String PROFILE___ELEMENT__ERROR_GENERATING_SNAPSHOT_ = "Profile___element__Error_generating_snapshot_";
public final static String PROFILE___BASE__COULD_NOT_BE_RESOLVED = "Profile___base__could_not_be_resolved";
public final static String PROFILE___HAS_NO_BASE_AND_NO_SNAPSHOT = "Profile___has_no_base_and_no_snapshot";
public final static String NO_VALIDATOR_CONFIGURED = "No_validator_configured";
public final static String PARSER_TYPE__NOT_SUPPORTED = "Parser_Type__not_supported";
public final static String VERSION_MISMATCH_THE_CONTEXT_HAS_VERSION__LOADED_AND_THE_NEW_CONTENT_BEING_LOADED_IS_VERSION_ = "Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loaded_is_version_";
public final static String ERROR_READING__FROM_PACKAGE__ = "Error_reading__from_package__";
public final static String ERROR_PARSING_ = "Error_parsing_";
public final static String UNABLE_TO_CONNECT_TO_TERMINOLOGY_SERVER_USE_PARAMETER_TX_NA_TUN_RUN_WITHOUT_USING_TERMINOLOGY_SERVICES_TO_VALIDATE_LOINC_SNOMED_ICDX_ETC_ERROR__ = "Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__";
public final static String DISPLAY_NAME_FOR__SHOULD_BE_ONE_OF__INSTEAD_OF_ = "Display_Name_for__should_be_one_of__instead_of_";
public final static String UNKNOWN_CODE__IN_ = "Unknown_Code__in_";
public final static String CODE_FOUND_IN_EXPANSION_HOWEVER_ = "Code_found_in_expansion_however_";
public final static String NONE_OF_THE_PROVIDED_CODES_ARE_IN_THE_VALUE_SET_ = "None_of_the_provided_codes_are_in_the_value_set_";
public final static String CODING_HAS_NO_SYSTEM__CANNOT_VALIDATE = "Coding_has_no_system__cannot_validate";
public final static String UNABLE_TO_HANDLE_SYSTEM__CONCEPT_FILTER_WITH_OP__ = "Unable_to_handle_system__concept_filter_with_op__";
public final static String UNABLE_TO_HANDLE_SYSTEM__FILTER_WITH_PROPERTY__ = "Unable_to_handle_system__filter_with_property__";
public final static String UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_INCLUDE_WITH_NO_SYSTEM = "Unable_to_resolve_system__value_set_has_include_with_no_system";
public final static String UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_IMPORTS = "Unable_to_resolve_system__value_set_has_imports";
public final static String UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_EXPANSION_HAS_MULTIPLE_SYSTEMS = "Unable_to_resolve_system__value_set_expansion_has_multiple_systems";
public final static String UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_NO_INCLUDES_OR_EXPANSION = "Unable_to_resolve_system__value_set_has_no_includes_or_expansion";
public final static String UNABLE_TO_RESOLVE_SYSTEM__VALUE_SET_HAS_EXCLUDES = "Unable_to_resolve_system__value_set_has_excludes";
public final static String UNABLE_TO_RESOLVE_SYSTEM__NO_VALUE_SET = "Unable_to_resolve_system__no_value_set";
public final static String THIS_BASE_PROPERTY_MUST_BE_AN_ARRAY_NOT_A_ = "This_base_property_must_be_an_Array_not_a_";
public final static String THIS_PROPERTY_MUST_BE_AN_ARRAY_NOT_A_ = "This_property_must_be_an_Array_not_a_";
public final static String DOCUMENT = "documentmsg";
}

View File

@ -64,17 +64,16 @@ public class BaseValidator {
protected Source source;
protected IWorkerContext context;
private ResourceBundle messages;
public BaseValidator(IWorkerContext context){
this.context = context;
messages = ResourceBundle.getBundle("Messages", context.getLocale() );
}
public void setContext(IWorkerContext context) {
this.context = context;
messages = ResourceBundle.getBundle("Messages", context.getLocale() );
}
// public void setContext(IWorkerContext context) {
// this.context = context;
// i18Nmessages = ResourceBundle.getBundle("Messages", context.getLocale() );
// }
/**
* Test a rule and add a {@link IssueSeverity#FATAL} validation message if the validation fails
@ -93,7 +92,7 @@ public class BaseValidator {
protected boolean fail(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String msg = formatMessage(theMessage, theMessageArguments);
String msg = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.FATAL);
}
return thePass;
@ -124,7 +123,7 @@ public class BaseValidator {
protected boolean fail(List<ValidationMessage> errors, IssueType type, List<String> pathParts, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String path = toPath(pathParts);
addValidationMessage(errors, type, -1, -1, path, formatMessage(theMessage, theMessageArguments), IssueSeverity.FATAL);
addValidationMessage(errors, type, -1, -1, path, context.formatMessage(theMessage, theMessageArguments), IssueSeverity.FATAL);
}
return thePass;
}
@ -143,21 +142,6 @@ public class BaseValidator {
return thePass;
}
protected String formatMessage(String theMessage, Object... theMessageArguments) {
String message = "";
if (messages.containsKey(theMessage)) {
if (theMessageArguments != null && theMessageArguments.length > 0) {
message = MessageFormat.format(messages.getString(theMessage), theMessageArguments);
} else if (messages.containsKey(theMessage)) {
message = messages.getString(theMessage);
}
} else {
message = theMessage;
}
return message;
}
protected boolean grammarWord(String w) {
return w.equals("and") || w.equals("or") || w.equals("a") || w.equals("the") || w.equals("for") || w.equals("this") || w.equals("that") || w.equals("of");
}
@ -171,7 +155,7 @@ public class BaseValidator {
*/
protected boolean hint(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg) {
if (!thePass) {
String message = formatMessage(msg);
String message = context.formatMessage(msg);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION);
}
return thePass;
@ -201,7 +185,7 @@ public class BaseValidator {
*/
protected boolean hint(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION);
}
return thePass;
@ -209,7 +193,7 @@ public class BaseValidator {
protected boolean txHint(List<ValidationMessage> errors, String txLink, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION, Source.TerminologyEngine).setTxLink(txLink);
}
return thePass;
@ -225,7 +209,7 @@ public class BaseValidator {
protected boolean hint(List<ValidationMessage> errors, IssueType type, List<String> pathParts, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String path = toPath(pathParts);
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.INFORMATION);
}
return thePass;
@ -254,7 +238,7 @@ public class BaseValidator {
*/
protected boolean rule(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.ERROR);
}
return thePass;
@ -262,7 +246,7 @@ public class BaseValidator {
protected boolean txRule(List<ValidationMessage> errors, String txLink, IssueType type, int line, int col, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
errors.add(new ValidationMessage(Source.TerminologyEngine, type, line, col, path, message, IssueSeverity.ERROR).setTxLink(txLink));
}
return thePass;
@ -293,7 +277,7 @@ public class BaseValidator {
protected boolean rule(List<ValidationMessage> errors, IssueType type, List<String> pathParts, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String path = toPath(pathParts);
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR);
}
return thePass;
@ -317,7 +301,7 @@ public class BaseValidator {
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR);
}
return thePass;
@ -381,7 +365,7 @@ public class BaseValidator {
*/
protected boolean warning(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
IssueSeverity severity = IssueSeverity.WARNING;
addValidationMessage(errors, type, line, col, path, msg, severity);
}
@ -409,7 +393,7 @@ public class BaseValidator {
*/
protected boolean txWarning(List<ValidationMessage> errors, String txLink, IssueType type, int line, int col, String path, boolean thePass, String msg, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
errors.add(new ValidationMessage(Source.TerminologyEngine, type, line, col, path, msg, IssueSeverity.WARNING).setTxLink(txLink));
}
return thePass;
@ -418,7 +402,7 @@ public class BaseValidator {
protected boolean warningOrError(boolean isError, List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
addValidationMessage(errors, type, line, col, path, msg, isError ? IssueSeverity.ERROR : IssueSeverity.WARNING);
}
return thePass;
@ -435,7 +419,7 @@ public class BaseValidator {
protected boolean warning(List<ValidationMessage> errors, IssueType type, List<String> pathParts, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String path = toPath(pathParts);
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.WARNING);
}
return thePass;
@ -478,7 +462,7 @@ public class BaseValidator {
*/
protected boolean warning(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg, String html, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
addValidationMessage(errors, type, path, msg, html, IssueSeverity.WARNING);
}
return thePass;
@ -494,7 +478,7 @@ public class BaseValidator {
*/
protected boolean suppressedwarning(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.INFORMATION);
}
return thePass;
@ -511,7 +495,7 @@ public class BaseValidator {
protected boolean suppressedwarning(List<ValidationMessage> errors, IssueType type, List<String> pathParts, boolean thePass, String theMessage, Object... theMessageArguments) {
if (!thePass) {
String path = toPath(pathParts);
String message = formatMessage(theMessage, theMessageArguments);
String message = context.formatMessage(theMessage, theMessageArguments);
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.INFORMATION);
}
return thePass;
@ -559,7 +543,7 @@ public class BaseValidator {
*/
protected boolean suppressedwarning(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg, String html, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
msg = context.formatMessage(msg, theMessageArguments);
addValidationMessage(errors, type, path, msg, html, IssueSeverity.INFORMATION);
}
return thePass;

View File

@ -126,6 +126,7 @@ import org.hl7.fhir.r5.utils.FHIRPathEngine;
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
import org.hl7.fhir.r5.utils.IResourceValidator;
import org.hl7.fhir.r5.utils.ToolingExtensions;
import org.hl7.fhir.utilities.I18nConstants;
import org.hl7.fhir.validation.BaseValidator;
import org.hl7.fhir.validation.instance.EnableWhenEvaluator.QStack;
import org.hl7.fhir.validation.XVerExtensionManager;
@ -141,7 +142,6 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
import org.hl7.fhir.utilities.xhtml.NodeType;
import org.hl7.fhir.utilities.xhtml.XhtmlNode;
import org.hl7.fhir.validation.instance.utils.*;
import org.hl7.fhir.validation.utils.I18nConstants;
import org.w3c.dom.Document;
import com.google.gson.Gson;
@ -209,17 +209,17 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
@Override
public FunctionDetails resolveFunction(String functionName) {
throw new Error(formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESRESOLVEFUNCTION_, functionName));
throw new Error(context.formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESRESOLVEFUNCTION_, functionName));
}
@Override
public TypeDetails checkFunction(Object appContext, String functionName, List<TypeDetails> parameters) throws PathEngineException {
throw new Error(formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESCHECKFUNCTION));
throw new Error(context.formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESCHECKFUNCTION));
}
@Override
public List<Base> executeFunction(Object appContext, String functionName, List<List<Base>> parameters) {
throw new Error(formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESEXECUTEFUNCTION));
throw new Error(context.formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESEXECUTEFUNCTION));
}
@Override
@ -252,7 +252,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
throw new FHIRException(e);
}
else
throw new Error(formatMessage(I18nConstants.NOT_DONE_YET__RESOLVE__LOCALLY_2, url));
throw new Error(context.formatMessage(I18nConstants.NOT_DONE_YET__RESOLVE__LOCALLY_2, url));
}
@ -281,7 +281,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ValidatorHostContext ctxt = (ValidatorHostContext) appContext;
StructureDefinition sd = context.fetchResource(StructureDefinition.class, url);
if (sd == null) {
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_, url));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_, url));
}
InstanceValidator self = InstanceValidator.this;
List<ValidationMessage> valerrors = new ArrayList<ValidationMessage>();
@ -297,10 +297,10 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (e.isResource()) {
self.validateResource(new ValidatorHostContext(ctxt.getAppContext(), e), valerrors, e, e, sd, IdStatus.OPTIONAL, new NodeStack(e));
} else {
throw new FHIRException(formatMessage(I18nConstants.NOT_SUPPORTED_YET));
throw new FHIRException(context.formatMessage(I18nConstants.NOT_SUPPORTED_YET));
}
} else
throw new NotImplementedException(formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESCONFORMSTOPROFILE_WHEN_ITEM_IS_NOT_AN_ELEMENT));
throw new NotImplementedException(context.formatMessage(I18nConstants.NOT_DONE_YET_VALIDATORHOSTSERVICESCONFORMSTOPROFILE_WHEN_ITEM_IS_NOT_AN_ELEMENT));
boolean ok = true;
List<ValidationMessage> record = new ArrayList<>();
for (ValidationMessage v : valerrors) {
@ -324,7 +324,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (r instanceof ValueSet)
return (ValueSet) r;
else
throw new FHIRException(formatMessage(I18nConstants.REFERENCE__REFERS_TO_A__NOT_A_VALUESET, url, r.fhirType()));
throw new FHIRException(context.formatMessage(I18nConstants.REFERENCE__REFERS_TO_A__NOT_A_VALUESET, url, r.fhirType()));
}
}
return null;
@ -527,7 +527,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
private StructureDefinition getSpecifiedProfile(String profile) {
StructureDefinition sd = context.fetchResource(StructureDefinition.class, profile);
if (sd == null) {
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_LOCATE_THE_PROFILE__IN_ORDER_TO_VALIDATE_AGAINST_IT, profile));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_LOCATE_THE_PROFILE__IN_ORDER_TO_VALIDATE_AGAINST_IT, profile));
}
return sd;
}
@ -1580,7 +1580,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ok = true;
}
} else {
throw new Error(formatMessage(I18nConstants.UNRECOGNISED_EXTENSION_CONTEXT_, ctxt.getTypeElement().asStringValue()));
throw new Error(context.formatMessage(I18nConstants.UNRECOGNISED_EXTENSION_CONTEXT_, ctxt.getTypeElement().asStringValue()));
}
}
if (!ok) {
@ -2107,7 +2107,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (we == null) {
if (fetcher == null) {
if (!refType.equals("contained"))
throw new FHIRException(formatMessage(I18nConstants.RESOURCE_RESOLUTION_SERVICES_NOT_PROVIDED));
throw new FHIRException(context.formatMessage(I18nConstants.RESOURCE_RESOLUTION_SERVICES_NOT_PROVIDED));
} else {
Element ext = null;
if (fetchCache.containsKey(ref)) {
@ -2202,7 +2202,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (!isShowMessagesFromReferences()) {
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, areAllBaseProfiles(profiles), I18nConstants.REFERENCE_REF_CANTMATCHCHOICE, ref, asList(type.getTargetProfile()));
for (StructureDefinition sd : badProfiles.keySet()) {
slicingHint(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false, "Details for " + ref + " matching against Profile" + sd.getUrl(), errorSummaryForSlicingAsHtml(badProfiles.get(sd)));
slicingHint(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false,
context.formatMessage(I18nConstants.DETAILS_FOR__MATCHING_AGAINST_PROFILE_, ref, sd.getUrl()), errorSummaryForSlicingAsHtml(badProfiles.get(sd)));
}
} else {
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, profiles.size() == 1, I18nConstants.REFERENCE_REF_CANTMATCHCHOICE, ref, asList(type.getTargetProfile()));
@ -2218,7 +2219,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (!isShowMessagesFromReferences()) {
warning(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false, I18nConstants.REFERENCE_REF_MULTIPLEMATCHES, ref, asListByUrl(goodProfiles.keySet()));
for (StructureDefinition sd : badProfiles.keySet()) {
slicingHint(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false, "Details for " + ref + " matching against Profile" + sd.getUrl(), errorSummaryForSlicingAsHtml(badProfiles.get(sd)));
slicingHint(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false, context.formatMessage(I18nConstants.DETAILS_FOR__MATCHING_AGAINST_PROFILE_, ref, sd.getUrl()), errorSummaryForSlicingAsHtml(badProfiles.get(sd)));
}
} else {
warning(errors, IssueType.STRUCTURE, element.line(), element.col(), path, false, I18nConstants.REFERENCE_REF_MULTIPLEMATCHES, ref, asListByUrl(goodProfiles.keySet()));
@ -2492,7 +2493,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
String id = p.hasExtension(ToolingExtensions.EXT_PROFILE_ELEMENT) ? p.getExtensionString(ToolingExtensions.EXT_PROFILE_ELEMENT) : null;
StructureDefinition sd = context.fetchResource(StructureDefinition.class, p.getValue());
if (sd == null)
throw new DefinitionException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_PROFILE_, p));
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_PROFILE_, p));
profile = sd;
if (id == null)
element = sd.getSnapshot().getElementFirstRep();
@ -2503,7 +2504,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
element = t;
}
if (element == null)
throw new DefinitionException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_ELEMENT__IN_PROFILE_, id, p));
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_ELEMENT__IN_PROFILE_, id, p));
}
expr = fpe.parse(fixExpr(discriminator));
t2 = System.nanoTime();
@ -2654,20 +2655,20 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (focus.fhirType().equals("Reference") && d.equals("reference")) {
String url = focus.getChildValue("reference");
if (Utilities.noString(url))
throw new FHIRException(formatMessage(I18nConstants.NO_REFERENCE_RESOLVING_DISCRIMINATOR__FROM_, discriminator, element.getProperty().getName()));
throw new FHIRException(context.formatMessage(I18nConstants.NO_REFERENCE_RESOLVING_DISCRIMINATOR__FROM_, discriminator, element.getProperty().getName()));
// Note that we use the passed in stack here. This might be a problem if the discriminator is deep enough?
Element target = resolve(appContext, url, stack, errors, p);
if (target == null)
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_FIND_RESOURCE__AT__RESOLVING_DISCRIMINATOR__FROM_, url, d, discriminator, element.getProperty().getName()));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_RESOURCE__AT__RESOLVING_DISCRIMINATOR__FROM_, url, d, discriminator, element.getProperty().getName()));
focus = target;
} else if (d.equals("value") && focus.isPrimitive()) {
return focus;
} else {
List<Element> children = focus.getChildren(d);
if (children.isEmpty())
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_FIND__RESOLVING_DISCRIMINATOR__FROM_, d, discriminator, element.getProperty().getName()));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_FIND__RESOLVING_DISCRIMINATOR__FROM_, d, discriminator, element.getProperty().getName()));
if (children.size() > 1)
throw new FHIRException(formatMessage(I18nConstants.FOUND__ITEMS_FOR__RESOLVING_DISCRIMINATOR__FROM_, Integer.toString(children.size()), d, discriminator, element.getProperty().getName()));
throw new FHIRException(context.formatMessage(I18nConstants.FOUND__ITEMS_FOR__RESOLVING_DISCRIMINATOR__FROM_, Integer.toString(children.size()), d, discriminator, element.getProperty().getName()));
focus = children.get(0);
p = p + "." + d;
}
@ -3092,23 +3093,23 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
discriminator = discriminator.substring(0, discriminator.indexOf('['));
type = criteriaElement.getType().get(0).getWorkingCode();
} else if (criteriaElement.getType().size() > 1) {
throw new DefinitionException(formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_, discriminator, ed.getId(), profile.getUrl(), criteriaElement.typeSummary()));
throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_, discriminator, ed.getId(), profile.getUrl(), criteriaElement.typeSummary()));
} else
throw new DefinitionException(formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl()));
throw new DefinitionException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES, discriminator, ed.getId(), profile.getUrl()));
if (discriminator.isEmpty())
expression.append(" and $this is " + type);
else
expression.append(" and " + discriminator + " is " + type);
} else if (s.getType() == DiscriminatorType.PROFILE) {
if (criteriaElement.getType().size() == 0) {
throw new DefinitionException(formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
}
if (criteriaElement.getType().size() != 1) {
throw new DefinitionException(formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
}
List<CanonicalType> list = discriminator.endsWith(".resolve()") || discriminator.equals("resolve()") ? criteriaElement.getType().get(0).getTargetProfile() : criteriaElement.getType().get(0).getProfile();
if (list.size() == 0) {
throw new DefinitionException(formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
throw new DefinitionException(context.formatMessage(I18nConstants.PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_, criteriaElement.getId(), profile.getUrl()));
} else if (list.size() > 1) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(" or ");
for (CanonicalType c : list) {
@ -3124,7 +3125,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
else if (criteriaElement.hasMax() && criteriaElement.getMax().equals("0"))
expression.append(" and (" + discriminator + ".exists().not())");
else
throw new FHIRException(formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_ELEMENT_EXISTENCE_BUT_SLICE__NEITHER_SETS_MIN1_OR_MAX0, discriminator, ed.getId()));
throw new FHIRException(context.formatMessage(I18nConstants.DISCRIMINATOR__IS_BASED_ON_ELEMENT_EXISTENCE_BUT_SLICE__NEITHER_SETS_MIN1_OR_MAX0, discriminator, ed.getId()));
} else if (criteriaElement.hasFixed()) {
buildFixedExpression(ed, expression, discriminator, criteriaElement);
} else if (criteriaElement.hasPattern()) {
@ -3142,15 +3143,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
}
if (!anyFound) {
if (slicer.getSlicing().getDiscriminator().size() > 1)
throw new DefinitionException(formatMessage(I18nConstants.COULD_NOT_MATCH_ANY_DISCRIMINATORS__FOR_SLICE__IN_PROFILE___NONE_OF_THE_DISCRIMINATOR__HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS, discriminators, ed.getId(), profile.getUrl(), discriminators));
throw new DefinitionException(context.formatMessage(I18nConstants.COULD_NOT_MATCH_ANY_DISCRIMINATORS__FOR_SLICE__IN_PROFILE___NONE_OF_THE_DISCRIMINATOR__HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS, discriminators, ed.getId(), profile.getUrl(), discriminators));
else
throw new DefinitionException(formatMessage(I18nConstants.COULD_NOT_MATCH_DISCRIMINATOR__FOR_SLICE__IN_PROFILE___THE_DISCRIMINATOR__DOES_NOT_HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS, discriminators, ed.getId(), profile.getUrl(), discriminators));
throw new DefinitionException(context.formatMessage(I18nConstants.COULD_NOT_MATCH_DISCRIMINATOR__FOR_SLICE__IN_PROFILE___THE_DISCRIMINATOR__DOES_NOT_HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS, discriminators, ed.getId(), profile.getUrl(), discriminators));
}
try {
n = fpe.parse(fixExpr(expression.toString()));
} catch (FHIRLexerException e) {
throw new FHIRException(formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, expression, profile.getUrl(), path, e.getMessage()));
throw new FHIRException(context.formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, expression, profile.getUrl(), path, e.getMessage()));
}
fpeTime = fpeTime + (System.nanoTime() - t);
ed.setUserData("slice.expression.cache", n);
@ -3159,10 +3160,13 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
ValidatorHostContext shc = hostContext.forSlicing();
boolean pass = evaluateSlicingExpression(shc, element, path, profile, n);
if (!pass) {
slicingHint(sliceInfo, IssueType.STRUCTURE, element.line(), element.col(), path, false, "Does not match slice'" + ed.getSliceName(), "discriminator = " + Utilities.escapeXml(n.toString()));
slicingHint(sliceInfo, IssueType.STRUCTURE, element.line(), element.col(), path, false, (context.formatMessage(I18nConstants.DOES_NOT_MATCH_SLICE_, ed.getSliceName())), "discriminator = " + Utilities.escapeXml(n.toString()));
for (String url : shc.getSliceRecords().keySet()) {
slicingHint(sliceInfo, IssueType.STRUCTURE, element.line(), element.col(), path, false, "Details for " + stack.getLiteralPath() + " against profile " + url,
"Profile " + url + " does not match for " + stack.getLiteralPath() + " because of the following profile issues: " + errorSummaryForSlicingAsHtml(shc.getSliceRecords().get(url)));
slicingHint(sliceInfo, IssueType.STRUCTURE, element.line(), element.col(), path, false,
context.formatMessage(I18nConstants.DETAILS_FOR__MATCHING_AGAINST_PROFILE_, stack.getLiteralPath(), url),
context.formatMessage(I18nConstants.PROFILE__DOES_NOT_MATCH_FOR__BECAUSE_OF_THE_FOLLOWING_PROFILE_ISSUES__,
url,
stack.getLiteralPath(), errorSummaryForSlicingAsHtml(shc.getSliceRecords().get(url))));
}
}
return pass;
@ -3178,7 +3182,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
msg = fpe.forLog();
} catch (Exception ex) {
ex.printStackTrace();
throw new FHIRException(formatMessage(I18nConstants.PROBLEM_EVALUATING_SLICING_EXPRESSION_FOR_ELEMENT_IN_PROFILE__PATH__FHIRPATH___, profile.getUrl(), path, n, ex.getMessage()));
throw new FHIRException(context.formatMessage(I18nConstants.PROBLEM_EVALUATING_SLICING_EXPRESSION_FOR_ELEMENT_IN_PROFILE__PATH__FHIRPATH___, profile.getUrl(), path, n, ex.getMessage()));
}
return ok;
}
@ -3197,14 +3201,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
Identifier ii = (Identifier) pattern;
expression.append(" and ");
buildIdentifierExpression(ed, expression, discriminator, ii);
} else
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_FIXED_PATTERN_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__, discriminator, ed.getId(), pattern.getClass().getName()));
} else {
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_FIXED_PATTERN_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__, discriminator, ed.getId(), pattern.getClass().getName()));
}
}
private void buildIdentifierExpression(ElementDefinition ed, StringBuilder expression, String discriminator, Identifier ii)
throws DefinitionException {
if (ii.hasExtension())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_IDENTIFIER_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_IDENTIFIER_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
boolean first = true;
expression.append(discriminator + ".where(");
if (ii.hasSystem()) {
@ -3238,15 +3243,15 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
private void buildCodeableConceptExpression(ElementDefinition ed, StringBuilder expression, String discriminator, CodeableConcept cc)
throws DefinitionException {
if (cc.hasText())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__USING_TEXT__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__USING_TEXT__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
if (!cc.hasCoding())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__MUST_HAVE_AT_LEAST_ONE_CODING__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__MUST_HAVE_AT_LEAST_ONE_CODING__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
if (cc.hasExtension())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
boolean firstCoding = true;
for (Coding c : cc.getCoding()) {
if (c.hasExtension())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
if (firstCoding) firstCoding = false;
else expression.append(" and ");
expression.append(discriminator + ".coding.where(");
@ -3277,7 +3282,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
private void buildCodingExpression(ElementDefinition ed, StringBuilder expression, String discriminator, Coding c)
throws DefinitionException {
if (c.hasExtension())
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_, discriminator, ed.getId()));
expression.append(discriminator + ".where(");
boolean first = true;
if (c.hasSystem()) {
@ -3333,7 +3338,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
} else if (fixed instanceof BooleanType) {
expression.append(((BooleanType) fixed).asStringValue());
} else
throw new DefinitionException(formatMessage(I18nConstants.UNSUPPORTED_FIXED_VALUE_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__, discriminator, ed.getId(), fixed.getClass().getName()));
throw new DefinitionException(context.formatMessage(I18nConstants.UNSUPPORTED_FIXED_VALUE_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__, discriminator, ed.getId(), fixed.getClass().getName()));
expression.append(" in " + discriminator + ")");
}
}
@ -3695,7 +3700,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
byte[] json = bs.toByteArray();
switch (v) {
case DSTU1:
throw new FHIRException(formatMessage(I18nConstants.UNSUPPORTED_VERSION_R1));
throw new FHIRException(context.formatMessage(I18nConstants.UNSUPPORTED_VERSION_R1));
case DSTU2:
org.hl7.fhir.dstu2.model.Resource r2 = new org.hl7.fhir.dstu2.formats.JsonParser().parse(json);
Resource r5 = VersionConvertor_10_50.convertResource(r2);
@ -4661,7 +4666,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
else
dt = this.context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + actualType);
if (dt == null)
throw new DefinitionException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_ACTUAL_TYPE_, actualType));
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_ACTUAL_TYPE_, actualType));
trackUsage(dt, hostContext, element);
childDefinitions = profileUtilities.getChildMap(dt, dt.getSnapshot().getElement().get(0));
@ -5018,8 +5023,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (slicer != null && slicer.getPath().equals(ed.getPath())) {
String errorContext = "profile " + profile.getUrl();
if (!resource.getChildValue(ID).isEmpty())
errorContext += "; instance " + resource.getChildValue(ID);
throw new DefinitionException(formatMessage(I18nConstants.SLICE_ENCOUNTERED_MIDWAY_THROUGH_SET_PATH___ID___, slicer.getPath(), slicer.getId(), errorContext));
errorContext += "; instance " + resource.getChildValue("id");
throw new DefinitionException(context.formatMessage(I18nConstants.SLICE_ENCOUNTERED_MIDWAY_THROUGH_SET_PATH___ID___, slicer.getPath(), slicer.getId(), errorContext));
}
slicer = ed;
process = false;
@ -5044,10 +5049,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (ei.additionalSlice && ei.definition != null) {
if (ei.definition.getSlicing().getRules().equals(ElementDefinition.SlicingRules.OPEN) ||
ei.definition.getSlicing().getRules().equals(ElementDefinition.SlicingRules.OPENATEND) && true /* TODO: replace "true" with condition to check that this element is at "end" */) {
slicingHint(errors, IssueType.INFORMATIONAL, ei.line(), ei.col(), ei.getPath(), false, "This element does not match any known slice" + (profile == null ? "" : " defined in the profile " + profile.getUrl()),
"This element does not match any known slice" + (profile == null ? "" : " defined in the profile " + profile.getUrl() + ": " + errorSummaryForSlicingAsHtml(ei.sliceInfo)));
slicingHint(errors, IssueType.INFORMATIONAL, ei.line(), ei.col(), ei.getPath(), false,
context.formatMessage(I18nConstants.THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_,
profile == null ? "" : " defined in the profile " + profile.getUrl()),
context.formatMessage(I18nConstants.THIS_ELEMENT_DOES_NOT_MATCH_ANY_KNOWN_SLICE_, profile == null ? "" : I18nConstants.DEFINED_IN_THE_PROFILE + profile.getUrl()) + errorSummaryForSlicingAsHtml(ei.sliceInfo));
} else if (ei.definition.getSlicing().getRules().equals(ElementDefinition.SlicingRules.CLOSED)) {
rule(errors, IssueType.INVALID, ei.line(), ei.col(), ei.getPath(), false, I18nConstants.VALIDATION_VAL_PROFILE_NOTSLICE, (profile == null ? "" : " defined in the profile " + profile.getUrl() + " and slicing is CLOSED: " + errorSummaryForSlicing(ei.sliceInfo)));
rule(errors, IssueType.INVALID, ei.line(), ei.col(), ei.getPath(), false, I18nConstants.VALIDATION_VAL_PROFILE_NOTSLICE, (profile == null ? "" : " defined in the profile " + profile.getUrl()), errorSummaryForSlicing(ei.sliceInfo));
}
} else {
// Don't raise this if we're in an abstract profile, like Resource
@ -5143,7 +5150,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (tail.equals(t.getId()))
return t;
}
throw new DefinitionException(formatMessage(I18nConstants.UNABLE_TO_FIND_ELEMENT_WITH_ID_, tail));
throw new DefinitionException(context.formatMessage(I18nConstants.UNABLE_TO_FIND_ELEMENT_WITH_ID_, tail));
}
private IdStatus idStatusForEntry(Element ep, ElementInfo ei) {
@ -5230,7 +5237,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
try {
n = fpe.parse(fixExpr(inv.getExpression()));
} catch (FHIRLexerException e) {
throw new FHIRException(formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, inv.getExpression(), profile.getUrl(), path, e.getMessage()));
throw new FHIRException(context.formatMessage(I18nConstants.PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__, inv.getExpression(), profile.getUrl(), path, e.getMessage()));
}
fpeTime = fpeTime + (System.nanoTime() - t);
inv.setUserData("validator.expression.cache", n);
@ -5369,9 +5376,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
checkFixedValue(msgs, "{virtual}", value, criteria.getFixed(), profile.getUrl(), "value", null);
return msgs.size() == 0;
} else if (criteria.hasBinding() && criteria.getBinding().getStrength() == BindingStrength.REQUIRED && criteria.getBinding().hasValueSet()) {
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SLICE_MATCHING__SLICE_MATCHING_BY_VALUE_SET_NOT_DONE));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SLICE_MATCHING__SLICE_MATCHING_BY_VALUE_SET_NOT_DONE));
} else {
throw new FHIRException(formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SLICE_MATCHING__NO_FIXED_VALUE_OR_REQUIRED_VALUE_SET));
throw new FHIRException(context.formatMessage(I18nConstants.UNABLE_TO_RESOLVE_SLICE_MATCHING__NO_FIXED_VALUE_OR_REQUIRED_VALUE_SET));
}
}
@ -5630,6 +5637,4 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
public void setDebug(boolean debug) {
this.debug = debug;
}
}

View File

@ -212,7 +212,7 @@ Validation_VAL_Profile_NoMatch = Unable to find matching profile among choices:
Validation_VAL_Profile_NoSnapshot = StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided
Validation_VAL_Profile_NoType = The type of element {0} is not known, which is illegal. Valid types at this point are {1}
Validation_VAL_Profile_NotAllowed = This element is not allowed by the profile {0}
Validation_VAL_Profile_NotSlice = This element does not match any known slice {0}
Validation_VAL_Profile_NotSlice = This element does not match any known slice {0} and slicing is CLOSED: {1}
Validation_VAL_Profile_OutOfOrder = As specified by profile {0}, Element "{1}" is out of order
Validation_VAL_Profile_SliceOrder = As specified by profile {0}, Element "{1}" is out of order in ordered slice
Validation_VAL_Profile_Unknown = Profile reference "{0}" could not be resolved, so has not been checked
@ -265,3 +265,166 @@ Not_done_yet__resolve__locally_2 = Not done yet - resolve {0} locally (2)
Not_done_yet_ValidatorHostServicesexecuteFunction = Not done yet (ValidatorHostServices.executeFunction)
Not_done_yet_ValidatorHostServicescheckFunction = Not done yet (ValidatorHostServices.checkFunction)
Not_done_yet_ValidatorHostServicesresolveFunction_ = Not done yet (ValidatorHostServices.resolveFunction): {0}
Unable_to_find_base_definition_for_logical_model__from_ = Unable to find base definition for logical model: {0} from {1}
Same_id_on_multiple_elements__in_ = Same id ''{0}''on multiple elements {1}/{2} in {3}
No_path_on_element_Definition__in_ = No path on element Definition {0} in {1}
needs_a_snapshot = needs a snapshot
not_the_right_kind_of_structure_to_generate_schematrons_for = not the right kind of structure to generate schematrons for
Not_handled_yet_sortElements_ = Not handled yet (sortElements: {0}:{1})
Unable_to_resolve_profile__in_element_ = Unable to resolve profile {0} in element {1}
Cant_have_children_on_an_element_with_a_polymorphic_type__you_must_slice_and_constrain_the_types_first_sortElements_ = Can''t have children on an element with a polymorphic type - you must slice and constrain the types first (sortElements: {0}:{1})
Unable_to_find_profile__at_ = Unable to find profile ''{0}'' at {1}
Unhandled_situation_resource_is_profiled_to_more_than_one_option__cannot_sort_profile = Unhandled situation: resource is profiled to more than one option - cannot sort profile
Internal_recursion_detection_find_loop_path_recursion____check_paths_are_valid_for_path_ = Internal recursion detection: find() loop path recursion > {0} - check paths are valid (for path {1}/{2})
Internal_error___type_not_known_ = Internal error - type not known {0}
Unable_to_find_element_ = Unable to find element {0}
Error_generating_table_for_profile__ = Error generating table for profile {0}: {1}
StructureDefinition__at__illegal_constrained_type__from__in_ = StructureDefinition {0} at {1}: illegal constrained type {2} from {3} in {4}
Error_at__The_target_profile__is_not__valid_constraint_on_the_base_ = Error at {0}#{1}: The target profile {2} is not valid constraint on the base ({3})
Error_in_profile__at__Base_isSummary___derived_isSummary__ = Error in profile {0} at {1}: Base isSummary = {2}, derived isSummary = {3}
StructureDefinition__at__illegal_attempt_to_change_a_binding_from__to_ = StructureDefinition {0} at {1}: illegal attempt to change a binding from {2} to {3}
Unexpected_condition_in_differential_typeslicetypelistsize__1_at_ = Unexpected condition in differential: type-slice.type-list.size() != 1 at {0}/{1}
Unexpected_condition_in_differential_typeslicetypelistsize__10_and_implicit_slice_name_does_not_contain_a_valid_type__at_ = Unexpected condition in differential: type-slice.type-list.size() == 10 and implicit slice name does not contain a valid type (''{0}''?) at {1}/{2}
Attempt_to_use_a_snapshot_on_profile__as__before_it_is_generated = Attempt to use a snapshot on profile ''{0}'' as {1} before it is generated
null_min = null min
_has_children__for_type__in_profile__but_cant_find_type = {0} has children ({1}) for type {2} in profile {3}, but can''t find type
_has_children__and_multiple_types__in_profile_ = {0} has children ({1}) and multiple types ({2}) in profile {3}
Adding_wrong_path = Adding wrong path
Named_items_are_out_of_order_in_the_slice=Named items are out of order in the slice
The_base_snapshot_marks_a_slicing_as_closed_but_the_differential_tries_to_extend_it_in__at__ = The base snapshot marks a slicing as closed, but the differential tries to extend it in {0} at {1} ({2})
Not_done_yet = Not done yet
Unknown_type__at_ = Unknown type {0} at {1}
Differential_walks_into____but_the_base_does_not_and_there_is_not_a_single_fixed_type_The_type_is__This_is_not_handled_yet = Differential walks into ''{0} (@ {1})'', but the base does not, and there is not a single fixed type. The type is {2}. This is not handled yet
Slicing_rules_on_differential__do_not_match_those_on_base___rule___ = Slicing rules on differential ({0}) do not match those on base ({1}) - rule @ {2} ({3})
Slicing_rules_on_differential__do_not_match_those_on_base___disciminator___ = Slicing rules on differential ({0}) do not match those on base ({1}) - disciminator @ {2} ({3})
Slicing_rules_on_differential__do_not_match_those_on_base___order___ = Slicing rules on differential ({0}) do not match those on base ({1}) - order @ {2} ({3})
not_done_yet__slicing__types__ = not done yet - slicing / types @ {0}
Invalid_slicing__there_is_more_than_one_type_slice_at__but_one_of_them__has_min__1_so_the_other_slices_cannot_exist=Invalid slicing: there is more than one type slice at {0}, but one of them ({1}) has min = 1, so the other slices cannot exist
Did_not_find_type_root_ = Did not find type root: {0}
Error_at_path__Slice_for_type__has_wrong_type_ = Error at path {0}: Slice for type ''{1}'' has wrong type ''{2}''
Error_at_path__Slice_for_type__has_more_than_one_type_ = Error at path {0}: Slice for type '{1}' has more than one type '{2}'
Error_at_path__Slice_name_must_be__but_is_ = Error at path {0}: Slice name must be ''{1}'' but is ''{2}''
Error_at_path__in__Type_slicing_with_slicingdiscriminatorpath__this = Error at path {0} in {1}: Type slicing with slicing.discriminator.path != ''$this''
Error_at_path__in__Type_slicing_with_slicingdiscriminatortype__type = Error at path {0} in {1}: Type slicing with slicing.discriminator.type != ''type''
Error_at_path__in__Type_slicing_with_slicingdiscriminatorcount__1 = Error at path {0} in {1}: Type slicing with slicing.discriminator.count() > 1
Error_at_path__in__Type_slicing_with_slicingordered__true = Error at path {0} in {1}: Type slicing with slicing.ordered = true
Adding_wrong_path_in_profile___vs_ = Adding wrong path in profile {0}: {1} vs {2}
_has_no_children__and_no_types_in_profile_ = {0} has no children ({1}) and no types in profile {2}
not_done_yet = not done yet
Did_not_find_single_slice_ = Did not find single slice: {0}
Differential_does_not_have_a_slice__b_of_____in_profile_ = Differential does not have a slice: {0}/ (b:{1} of {2} / {3}/ {4}) in profile {5}
Attempt_to_a_slice_an_element_that_does_not_repeat__from__in_ = Attempt to a slice an element that does not repeat: {0}/{1} from {2} in {3}
Unable_to_resolve_reference_to_ = Unable to resolve reference to {0}
Unable_to_find_element__in_ = Unable to find element {0} in {1}
Unable_to_find_base__for_ = Unable to find base {0} for {1}
Adding_wrong_path__outcomegetPath___resultPathBase__ = Adding wrong path - outcome.getPath() = {0}, resultPathBase = {1}
Illegal_path__in_differential_in__illegal_characters_ = Illegal path ''{0}'' in differential in {1}: illegal characters []
Illegal_path__in_differential_in__illegal_character_ = Illegal path ''{0}'' in differential in {1}: illegal character ''{2}''
Illegal_path__in_differential_in__no_unicode_whitespace = Illegal path ''{0}'' in differential in {1}: no unicode whitespace
Illegal_path__in_differential_in__name_portion_exceeds_64_chars_in_length = Illegal path ''{0}'' in differential in {1}: name portion exceeds 64 chars in length
Illegal_path__in_differential_in__name_portion_mising_ = Illegal path ''{0}'' in differential in {1}: name portion missing (''..'')
Illegal_path__in_differential_in__must_start_with_ = Illegal path ''{0}'' in differential in {1}: must start with {2}.{3}
No_path_value_on_element_in_differential_in_ = No path value on element in differential in {0}
No_path_on_element_in_differential_in_ = No path on element in differential in {0}
Unxpected_internal_condition__no_source_on_diff_element = Unxpected internal condition - no source on diff element
type_on_first_snapshot_element_for__in__from_ = type on first snapshot element for {0} in {1} from {2}
type_on_first_differential_element = type on first differential element!
Circular_snapshot_references_detected_cannot_generate_snapshot_stack__ = Circular snapshot references detected; cannot generate snapshot (stack = {0})
Base__Derived_profiles_have_different_types____vs___ = Base & Derived profiles have different types ({0} = {1} vs {2} = {3})
Derived_profile__has_no_derivation_value_and_so_cant_be_processed = Derived profile {0} has no derivation value and so can''t be processed
Derived_profile__has_no_type = Derived profile {0} has no type
Base_profile__has_no_type = Base profile {0} has no type
no_derived_structure_provided = no derived structure provided
no_base_profile_provided = no base profile provided
element_id__null__on_ = element id = null: {0} on {1}
element__null_ = element = null: {0}
getSliceList_should_only_be_called_when_the_element_has_slicing = getSliceList should only be called when the element has slicing
Unable_to_resolve_name_reference__at_path_ = Unable to resolve name reference {0} at path {1}
Details_for__matching_against_Profile_ = Details for {0} matching against Profile{1}
Does_not_match_slice_ = Does not match slice "{0}"
Profile__does_not_match_for__because_of_the_following_profile_issues__ = Profile {0} does not match for {1} because of the following profile issues: {2}
This_element_does_not_match_any_known_slice_ = This element does not match any known slice{0}
defined_in_the_profile = defined in the profile
This_does_not_appear_to_be_a_FHIR_resource_unknown_name_ = This does not appear to be a FHIR resource (unknown name "{0}")
This_cannot_be_parsed_as_a_FHIR_object_no_name = This cannot be parsed as a FHIR object (no name)
This_does_not_appear_to_be_a_FHIR_resource_unknown_namespacename_ = This does not appear to be a FHIR resource (unknown namespace/name "{0}::{1}")
This__cannot_be_parsed_as_a_FHIR_object_no_namespace = This "{0}2 cannot be parsed as a FHIR object (no namespace)
Unable_to_find_resourceType_property = Unable to find resourceType property
Error_parsing_JSON_the_primitive_value_must_be_a_string = Error parsing JSON: the primitive value must be a string
Error_parsing_JSON_the_primitive_value_must_be_a_number = Error parsing JSON: the primitive value must be a number
Error_parsing_JSON_the_primitive_value_must_be_a_boolean = Error parsing JSON: the primitive value must be a boolean
Error_parsing_XHTML_ = Error parsing XHTML: {0}
This_property_must_be_an_object_not_ = This property must be an object, not {0}
This_property_must_be_an_simple_value_not_ = This property must be an simple value, not {0}
This_property_must_be__not_ = This property must be {0}, not {1}
This_property_must_be_an_Array_not_ = This property must be an Array, not {0}
Unrecognised_property_ = Unrecognised property ''@{0}''
Object_must_have_some_content = Object must have some content
Error_parsing_JSON_ = Error parsing JSON: {0}
Node_type__is_not_allowed = Node type {0} is not allowed
CDATA_is_not_allowed = CDATA is not allowed
Undefined_element_ = Undefined element ''{0}''
Undefined_attribute__on__for_type__properties__ = Undefined attribute ''@{0}'' on {1} for type {2} (properties = {3})
Text_should_not_be_present = Text should not be present
Wrong_namespace__expected_ = Wrong namespace - expected ''{0}''
Element_must_have_some_content = Element must have some content
No_processing_instructions_allowed_in_resources = No processing instructions allowed in resources
Unknown_resource_type_missing_rdfstype = Unknown resource type (missing rdfs:type)
reference_to__cannot_be_resolved = reference to {0} cannot be resolved
This_property_must_be_a_URI_or_bnode_not_a_ = This property must be a URI or bnode, not a {0}
This_property_must_be_a_Literal_not_a_ = This property must be a Literal, not a {0}
Unrecognised_predicate_ = Unrecognised predicate ''{0}''
Error_parsing_Turtle_ = Error parsing Turtle: {0}
Unexpected_datatype_for_rdfstype = Unexpected datatype for rdfs:type
Attempt_to_replace_element_name_for_a_nonchoice_type=Attempt to replace element name for a non-choice type
Wrong_type_for_resource = Wrong type for resource
Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_ = Contained resource does not appear to be a FHIR resource (unknown name ''{0}'')
Unknown_Date_format_ = Unknown Date format ''{0}''
Unknown_Data_format_ = Unknown Data format ''{0}''
No_type_found_on_ = No type found on ''{0}''
error_writing_number__to_JSON = error writing number ''{0}'' to JSON
Unable_to_process_request_for_resource_for___ = Unable to process request for resource for {0} / {1}
Resource_type_mismatch_for___ = Resource type mismatch for {0} / {1}
not_done_yet_cant_fetch_ = not done yet: can''t fetch {0}
Attempt_to_use_Terminology_server_when_no_Terminology_server_is_available = Attempt to use Terminology server when no Terminology server is available
No_ExpansionProfile_provided = No ExpansionProfile provided
Can_only_specify_profile_in_the_context = Can only specify profile in the context
no_url_in_expand_value_set_2 = no url in expand value set 2
no_url_in_expand_value_set = no url in expand value set
no_value_set = no value set
No_Parameters_provided_to_expandVS = No Parameters provided to expandVS
No_Expansion_Parameters_provided = No Expansion Parameters provided
Unable_to_resolve_value_Set_ = Unable to resolve value Set {0}
Delimited_versions_have_exact_match_for_delimiter____vs_ = Delimited versions have exact match for delimiter ''{0}'' : {1} vs {2}
Duplicate_Resource_ = Duplicate Resource {0}
Error_expanding_ValueSet_running_without_terminology_services = Error expanding ValueSet: running without terminology services
Error_validating_code_running_without_terminology_services = Error validating code: running without terminology services
Unable_to_validate_code_without_using_server = Unable to validate code without using server
Profile___Error_generating_snapshot = Profile {0} ({1}). Error generating snapshot
Profile___element__Error_generating_snapshot_ = Profile {0} ({1}), element {2}. Error generating snapshot: {3}
Profile___base__could_not_be_resolved = Profile {0} ({1}) base {2} could not be resolved
Profile___has_no_base_and_no_snapshot = Profile {0} ({1}) has no base and no snapshot
No_validator_configured = No validator configured
Parser_Type__not_supported = Parser Type {0} not supported
Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loaded_is_version_ = Version mismatch. The context has version {0} loaded, and the new content being loaded is version {1}
Error_reading__from_package__ = Error reading {0} from package {1}#{2}: {3}
Error_parsing_ = Error parsing {0}:{1}
Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__ = Unable to connect to terminology server. Use parameter ''-tx n/a'' tun run without using terminology services to validate LOINC, SNOMED, ICD-X etc. Error = {0}
Display_Name_for__should_be_one_of__instead_of_ = Display Name for {0}#{1} should be one of ''{2}'' instead of ''{3}''
Unknown_Code__in_ = Unknown Code {0} in {1}
Code_found_in_expansion_however_ = Code found in expansion, however: {0}
None_of_the_provided_codes_are_in_the_value_set_ = None of the provided codes are in the value set {0}
Coding_has_no_system__cannot_validate = Coding has no system - cannot validate
Unable_to_handle_system__concept_filter_with_op__ = Unable to handle system {0} concept filter with op = {1}
Unable_to_handle_system__filter_with_property__ = Unable to handle system {0} filter with property = {1}
Unable_to_resolve_system__value_set_has_include_with_no_system = Unable to resolve system - value set has include with no system
Unable_to_resolve_system__value_set_has_imports = Unable to resolve system - value set has imports
Unable_to_resolve_system__value_set_expansion_has_multiple_systems = Unable to resolve system - value set expansion has multiple systems
Unable_to_resolve_system__value_set_has_no_includes_or_expansion = Unable to resolve system - value set has no includes or expansion
Unable_to_resolve_system__value_set_has_excludes = Unable to resolve system - value set has excludes
Unable_to_resolve_system__no_value_set = Unable to resolve system - no value set
This_base_property_must_be_an_Array_not_a_ = This base property must be an Array, not a {0}
This_property_must_be_an_Array_not_a_ = This property must be an Array, not a {0}
documentmsg = (document)

View File

@ -1,267 +1,431 @@
#InstanceValidator
Bundle_BUNDLE_Entry_Canonical = The canonical URL ({0}) cannot match the fullUrl ({1}) unless on the canonical server itself
Bundle_BUNDLE_Entry_Document = The first entry in a document must be a composition
Bundle_BUNDLE_Entry_IdUrlMismatch = Resource ID does not match the ID in the entry full URL ("{0}" vs "{1}")
Bundle_BUNDLE_Entry_MismatchIdUrl = The canonical URL ({0}) cannot match the fullUrl ({1}) unless the resource id ({2}) also matches
Bundle_BUNDLE_Entry_NoFirst = Documents or Messages must contain at least one entry
Bundle_BUNDLE_Entry_NoFirstResource = No resource on first entry
Bundle_BUNDLE_Entry_NoFullUrl = Bundle entry missing fullUrl
Bundle_BUNDLE_Entry_NoProfile = No profile found for contained resource of type "{0}"
Bundle_BUNDLE_Entry_NotFound = Can''t find "{0}" in the bundle ({1})
Bundle_BUNDLE_Entry_Orphan = Entry {0} isn''t reachable by traversing from first Bundle entry
Bundle_BUNDLE_Entry_Type = The type "{0}" is not valid - no resources allowed here
Bundle_BUNDLE_Entry_Type2 = The type "{0}" is not valid - must be {1}
Bundle_BUNDLE_Entry_Type3 = The type "{0}" is not valid - must be one of {1}
Bundle_BUNDLE_FullUrl_Missing = Relative Reference appears inside Bundle whose entry is missing a fullUrl
Bundle_BUNDLE_FullUrl_NeedVersion = Entries matching fullURL {0} should declare meta/versionId because there are version-specific references
Bundle_BUNDLE_MultipleMatches = Multiple matches in bundle for reference {0}
Bundle_BUNDLE_Not_Local = URN reference is not locally contained within the bundle {0}
Bundle_MSG_Event_Count = Expected {0} but found {1} event elements
CapabalityStatement_CS_SP_WrongType = Type mismatch - SearchParameter "{0}" type is {1}, but type here is {2}
CodeSystem_CS_VS_IncludeDetails = CodeSystem {0} has a ''all system'' value set of {1}, but the include has extra details
CodeSystem_CS_VS_Invalid = CodeSystem {0} has a ''all system'' value set of {1}, but doesn''t have a single include
CodeSystem_CS_VS_MisMatch = CodeSystem {0} has a ''all system'' value set of {1}, but it is an expansion
CodeSystem_CS_VS_WrongSystem = CodeSystem {0} has a ''all system'' value set of {1}, but doesn''t have a matching system ({2})
Extension_EXT_Context_Wrong = The extension {0} is not allowed to be used at this point (allowed = {1}; this element is [{2})
Extension_EXT_Count_Mismatch = Extensions count mismatch: expected {0} but found {1}
Extension_EXT_Count_NotFound = Extension count mismatch: unable to find extension: {0}
Extension_EXT_Fixed_Banned = No extensions allowed, as the specified fixed value doesn''t contain any extensions
Extension_EXT_Modifier_MismatchN = Extension modifier mismatch: the extension element is not labelled as a modifier, but the underlying extension is
Extension_EXT_Modifier_MismatchY = Extension modifier mismatch: the extension element is labelled as a modifier, but the underlying extension is not
Extension_EXT_Modifier_N = The Extension "{0}" must not be used as an extension (it''s a modifierExtension)
Extension_EXT_Modifier_Y = The Extension "{0}" must be used as a modifierExtension
Extension_EXT_Simple = The Extension "{0}" definition is for a simple extension, so it must contain a value, not extensions
Extension_EXT_SubExtension_Invalid = Sub-extension url "{0}" is not defined by the Extension {1}
Extension_EXT_Type = The Extension "{0}" definition allows for the types {1} but found type {2}
Extension_EXT_URL_Absolute = Extension.url must be an absolute URL
Extension_EXT_Unknown = Unknown extension {0}
Extension_EXT_Unknown_NotHere = The extension {0} is unknown, and not allowed here
Extension_EXT_Url_NotFound = Extension.url is required
Extension_EXT_Version_Internal = Extension url "{0}" evaluation state illegal
Extension_EXT_Version_Invalid = Extension url "{0}" is not valid (invalid Version "{1}")
Extension_EXT_Version_InvalidId = Extension url "{0}" is not valid (invalid Element id "{1}")
Extension_EXT_Version_NoChange = Extension url "{0}" is not valid (Element id "{1}" is valid, but cannot be used in a cross-version paradigm because there has been no changes across the relevant versions)
Fixed_Type_Checks_DT_Address_Line = Expected {0} but found {1} line elements
Fixed_Type_Checks_DT_Name_Family = Expected {0} but found {1} family elements
Fixed_Type_Checks_DT_Name_Given = Expected {0} but found {1} given elements
Fixed_Type_Checks_DT_Name_Prefix = Expected {0} but found {1} prefix elements
Fixed_Type_Checks_DT_Name_Suffix = Expected {0} but found {1} suffix elements
Internal_INT_Bad_Type = Unhandled fixed value type {0}
Language_XHTML_Lang_Different1 = Resource has a language ({0}), and the XHTML has a lang ({1}), but they differ
Language_XHTML_Lang_Different2 = Resource has a language ({0}), and the XHTML has an xml:lang ({1}), but they differ
Language_XHTML_Lang_Missing1 = Resource has a language, but the XHTML does not have an lang or an xml:lang tag (needs both - see https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Language_XHTML_Lang_Missing2 = Resource has a language, but the XHTML does not have a lang tag (needs both lang and xml:lang - see https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Language_XHTML_Lang_Missing3 = Resource has a language, but the XHTML does not have an xml:lang tag (needs both lang and xml:lang - see https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Meta_RES_Security_Duplicate = Duplicate Security Label {0}
MustSupport_VAL_MustSupport = The element {0} is not marked as ''mustSupport'' in the profile {1}. Consider not using the element, or marking the element as must-Support in the profile
Profile_EXT_Not_Here = The extension {0} is not allowed to be used at this point (based on context invariant "{1}")
Profile_VAL_MissingElement = Missing element "{0}" - required by fixed value assigned in profile {1}
Profile_VAL_NotAllowed = The element {0} is present in the instance but not allowed in the applicable {1} specified in profile
Questionnaire_QR_Item_BadOption = The value provided ({0}::{1}) is not in the options value set in the questionnaire
Questionnaire_QR_Item_Coding = Error {0} validating Coding against Questionnaire Options
Questionnaire_QR_Item_CodingNoOptions = Cannot validate Coding option because no option list is provided
Questionnaire_QR_Item_DateNoOptions = Cannot validate date answer option because no option list is provided
Questionnaire_QR_Item_Display = Items not of type DISPLAY should not have items - linkId {0}
Questionnaire_QR_Item_Group = Items of type group should not have answers
Questionnaire_QR_Item_IntNoOptions = Cannot validate integer answer option because no option list is provided
Questionnaire_QR_Item_Missing = No response answer found for required item {0}
Questionnaire_QR_Item_NoCoding = The code {0}::{1} is not a valid option
Questionnaire_QR_Item_NoDate = The date {0} is not a valid option
Questionnaire_QR_Item_NoInteger = The integer {0} is not a valid option
Questionnaire_QR_Item_NoLinkId = No LinkId, so can''t be validated
Questionnaire_QR_Item_NoOptions = Cannot validate options because no option or options are provided
Questionnaire_QR_Item_NoOptionsCoding = Option list has no option values of type coding
Questionnaire_QR_Item_NoOptionsDate = Option list has no option values of type date
Questionnaire_QR_Item_NoOptionsInteger = Option list has no option values of type integer
Questionnaire_QR_Item_NoOptionsString = Option list has no option values of type string
Questionnaire_QR_Item_NoOptionsTime = Option list has no option values of type time
Questionnaire_QR_Item_NoString = The string {0} is not a valid option
Questionnaire_QR_Item_NoTime = The time {0} is not a valid option
Questionnaire_QR_Item_NoType = Definition for item {0} does not contain a type
Questionnaire_QR_Item_NotEnabled = Item has answer (2), even though it is not enabled {0}
Questionnaire_QR_Item_NotEnabled2 = Item has answer, even though it is not enabled (item id = "{0}")
Questionnaire_QR_Item_NotFound = LinkId "{0}" not found in questionnaire
Questionnaire_QR_Item_OnlyOneA = Only one response answer item with this linkId allowed
Questionnaire_QR_Item_OnlyOneI = Only one response item with this linkId allowed - {0}
Questionnaire_QR_Item_Order = Structural Error: items are out of order
Questionnaire_QR_Item_StringNoOptions = Cannot validate string answer option because no option list is provided
Questionnaire_QR_Item_Text = If text exists, it must match the questionnaire definition for linkId {0}
Questionnaire_QR_Item_TimeNoOptions = Cannot validate time answer option because no option list is provided
Questionnaire_QR_Item_WrongType = Answer value must be of type {0}
Questionnaire_QR_Item_WrongType2 = Answer value must be one of the types {0}
Questionnaire_QR_Q_None = No questionnaire is identified, so no validation can be performed against the base questionnaire
Questionnaire_QR_Q_NotFound = The questionnaire "{0}" could not be resolved, so no validation can be performed against the base questionnaire
Questionnaire_Q_EnableWhen_After = The target of this enableWhen rule ({0}) comes after the question itself
Questionnaire_Q_EnableWhen_IsInner = Questions with an enableWhen cannot refer to an inner question for it''s enableWhen condition
Questionnaire_Q_EnableWhen_NoLink = Questions with an enableWhen must have a value for the question link
Questionnaire_Q_EnableWhen_NoTarget = Unable to find target "{0}" for this question enableWhen
Questionnaire_Q_EnableWhen_Self = Target for this question enableWhen can''t reference itself
Reference_REF_Aggregation = Reference is {0} which isn''t supported by the specified aggregation mode(s) for the reference
Reference_REF_BadTargetType = Invalid Resource target type. Found {0}, but expected one of ({1})
Reference_REF_BadTargetType2 = The type "{0}" implied by the reference URL {1} is not a valid Target for this element (must be one of {2})
Reference_REF_CantMatchChoice = Unable to find matching profile for {0} among choices: {1}
Reference_REF_CantMatchType = Unable to find matching profile for {0} (by type) among choices: {1}
Reference_REF_CantResolve = Unable to resolve resource "{0}"
Reference_REF_CantResolveProfile = Unable to resolve the profile reference "{0}"
Reference_REF_Format1 = Relative URLs must be of the format [ResourceName]/[id], or a search ULR is allowed ([type]?parameters. Encountered {0})
Reference_REF_Format2 = Relative URLs must be of the format [ResourceName]/[id]. Encountered {0}
Reference_REF_MultipleMatches = Found multiple matching profiles for {0} among choices: {1}
Reference_REF_NoDisplay = A Reference without an actual reference or identifier should have a display
Reference_REF_NoType = Unable to determine type of target resource
Reference_REF_NotFound_Bundle = Bundled or contained reference not found within the bundle/resource {0}
Reference_REF_ResourceType = Matching reference for reference {0} has resourceType {1}
Reference_REF_WrongTarget = The type "{0}" is not a valid Target for this element (must be one of {1})
Resource_RES_ID_Missing = Resource requires an id, but none is present
Resource_RES_ID_Prohibited = Resource has an id, but none is allowed
Bundle_BUNDLE_Entry_Canonical=Die canonical URL ({0}) stimmt nicht mit der fullUrl Url ({1}) überein sofern sie sich nicht auf dem canonical Server selbst befindet.
Bundle_BUNDLE_Entry_Document=Der erste Eintrag in einem document muss eine composition sein
Bundle_BUNDLE_Entry_IdUrlMismatch=Die Ressourcen-ID stimmt nicht mit der ID in der fullUrl überein ("{0}" vs. "{1}")
Bundle_BUNDLE_Entry_MismatchIdUrl=Die canonical URL ({0}) stimmt nicht mit der fullUrl ({1}) überein solange die Ressourcen-ID ({2}) nicht auch übereinstimmt
Bundle_BUNDLE_Entry_NoFirst=Documents oder Messages müssen mindestens einen Eintrag enthalten
Bundle_BUNDLE_Entry_NoFirstResource=Keine Ressource im ersten entry
Bundle_BUNDLE_Entry_NoFullUrl=Bundle-entry fehlt die fullUrl
Bundle_BUNDLE_Entry_NoProfile=Kein Profil für die contained Ressource vom Typ "{0}" gefunden
Bundle_BUNDLE_Entry_NotFound="{0}" konnte nicht in bundle ({1}) gefunden werden
Bundle_BUNDLE_Entry_Orphan=Entry {0} ist nicht durch Traversierung, vom ersten Bundle-Entry ausgehend, erreichbar
Bundle_BUNDLE_Entry_Type=Der type "{0}" ist nicht gültig - hier sind keine Ressourcen erlaubt
Bundle_BUNDLE_Entry_Type2=Der type "{0}" ist nicht gültig - muss {1} sein\
Bundle_BUNDLE_Entry_Type3=Der type "{0}" ist nicht gültig - muss einer von {1} sein
Bundle_BUNDLE_FullUrl_Missing=Es besteht eine relative Reference innerhalb des Bundle, dessen Eintrag eine fullUrl fehlt
Bundle_BUNDLE_FullUrl_NeedVersion=Einträge, die mit fullURL {0} übereinstimmen, sollten meta/versionId deklarieren, da versionsspezifische Referenzen vorhanden sind.
Bundle_BUNDLE_MultipleMatches=Mehrere Übereinstimmungen im Bundle für reference {0}
Bundle_BUNDLE_Not_Local=URN reference ist nicht lokal innerhalb des Bundles contained {0}
Bundle_MSG_Event_Count=Erwartet {0}, aber gefundene {1} event Elemente
CapabalityStatement_CS_SP_WrongType=Typabweichung - SearchParameter "{0}" sollte type {1} sein, ist aber {2}
CodeSystem_CS_VS_IncludeDetails=CodeSystem {0} hat einen ''all system'' ValueSet von {1}, aber das Include beeinhaltet zusätzliche Details
CodeSystem_CS_VS_Invalid=CodeSystem {0} hat einen ''all system'' ValueSet von {1}, aber keinen einzigen include
CodeSystem_CS_VS_MisMatch=CodeSystem {0} hat einen ''all system'' ValueSet von {1}, aber es ist eine expansion
CodeSystem_CS_VS_WrongSystem=CodeSystem {0} hat einen ''all system'' ValueSet von {1}, aber besitzt kein passendes system ({2})
Extension_EXT_Context_Wrong=Die Erweiterung {0} darf an dieser Stelle nicht verwendet werden (erlaubt = {1}; dieses Element ist [{2}])
Extension_EXT_Count_Mismatch=Abweichungen bei Anzahl der Extensions: erwartet {0}, aber gefunden {1}
Extension_EXT_Count_NotFound=Ungleiche Anzahl von Extensions: Extensions {0} kann nicht gefunden werden
Extension_EXT_Fixed_Banned=Keine Extensions erlaubt, da der angegebene fixed value keine Extension enthält
Extension_EXT_Modifier_MismatchN=Abweichung des Extension modifiers: Die Extension ist nicht als modifier gekennzeichnet, im Gegensatz zur zugrunde liegenden Extension
Extension_EXT_Modifier_MismatchY=Abweichung des Extension modifiers: Die Extension ist als modifier gekennzeichnet, im Gegensatz zur zugrunde liegenden Extension
Extension_EXT_Modifier_N=Die Extension "{0}" darf nicht als Extension verwendet werden (es handelt sich um eine ModifierExtension)
Extension_EXT_Modifier_Y=Die Extension "{0}" muss als modifierExtension verwendet werden
Extension_EXT_Simple=Die Definition der Extension "{0}" impliziert eine simple Extension, sie muss also einen Wert enthalten, keine Extensions.
Extension_EXT_SubExtension_Invalid=Die Unter-Extension url "{0}" ist nicht durch die Extension {1} definiert
Extension_EXT_Type=Die Definition der Extension "{0}" erlaubt die Typen {1}, Typ {2} wurde gefunden
Extension_EXT_URL_Absolute=Extension.url muss eine absolute URL sein.
Extension_EXT_Unknown=Unbekannte extension {0}
Extension_EXT_Unknown_NotHere=Die extension {0} ist nicht bekannt, and hier nicht erlaubt
Extension_EXT_Url_NotFound=Extension.url ist erforderlich
Extension_EXT_Version_Internal=Extension url "{0}" Prüfung fehlgeschlagen
Extension_EXT_Version_Invalid=Extension url "{0}" ist nicht gültig (ungültige Version "{1}")
Extension_EXT_Version_InvalidId=Extension url "{0}" ist nicht gültig (ungültige Element id "{1}")
Extension_EXT_Version_NoChange=Die Extension url "{0}" ist nicht gültig (Element id "{1}" ist gültig, kann aber nicht in einem versionenübergreifenden Paradigma verwendet werden, da es keine Änderungen in den relevanten Versionen gegeben hat)
Fixed_Type_Checks_DT_Address_Line=Erwartet {0}, aber gefundene {1} line Elemente
Fixed_Type_Checks_DT_Name_Family=Erwartet {0}, aber gefundene {1} family Elemente
Fixed_Type_Checks_DT_Name_Given=Erwartet {0}, aber gefundene {1} given Elemente
Fixed_Type_Checks_DT_Name_Prefix=Erwartet {0}, aber gefundene {1} prefix Elemente
Fixed_Type_Checks_DT_Name_Suffix=Erwartet {0}, aber gefundene {1} suffix Elemente
Internal_INT_Bad_Type=Unbehandelter fixed value type {0}
Language_XHTML_Lang_Different1=Die Ressource hat eine Sprache ({0}), und das XHTML hat eine Sprache ({1}), aber sie unterscheiden sich
Language_XHTML_Lang_Different2=Die Ressource hat language ({0}), und das XHTML hat xml:lang ({1}), aber sie unterscheiden sich
Language_XHTML_Lang_Missing1=Die Ressource hat eine language, aber das XHTML hat kein lang oder ein xml:lang Tag (benötigt beides - siehe https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Language_XHTML_Lang_Missing2=Die Ressource hat eine language, aber das XHTML hat kein lang-Tag (benötigt sowohl lang als auch xml:lang - siehe https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Language_XHTML_Lang_Missing3=Die Ressource hat eine language, aber das XHTML hat kein xml:lang-Tag (benötigt sowohl lang als auch xml:lang - siehe https://www.w3.org/TR/i18n-html-tech-lang/#langvalues)
Meta_RES_Security_Duplicate=Dupliziertes Security Label {0}
MustSupport_VAL_MustSupport=Das Element {0} ist im Profil {1} nicht als ''mustSupport'' gekennzeichnet. Erwägen Sie, das Element nicht zu verwenden oder das Element als "must-Support" im Profil zu markieren.
Profile_EXT_Not_Here=Die Extension {0} darf an dieser Stelle nicht verwendet werden (basierend auf der Kontextinvariante "{1}")
Profile_VAL_MissingElement=Fehlendes Element "{0}" - erforderlich durch den im Profil zugewiesenen festen Wert {1}
Profile_VAL_NotAllowed=Das Element {0} ist in der Instanz vorhanden, aber im zutreffenden {1}, das im Profil angegeben ist, nicht erlaubt.
Questionnaire_QR_Item_BadOption=Der angegebene Wert ({0}::{1}) ist nicht in den im Fragebogen gesetzten options value set enthalten.
Questionnaire_QR_Item_Coding=Fehler {0} bei der Validierung des Coding gegen Questionnaire Options
Questionnaire_QR_Item_CodingNoOptions=Coding option kann nicht validiert werden, da keine option list bereitgestellt wird
Questionnaire_QR_Item_DateNoOptions=Date answer option kann nicht validiert werden, weil keine option list zur Verfügung steht
Questionnaire_QR_Item_Display=Elemente, die nicht vom Typ DISPLAY sind, sollten keine Elemente enhtalten - linkId {0}
Questionnaire_QR_Item_Group=Elemente der Typgruppe sollten keine Antworten beinhalten
Questionnaire_QR_Item_IntNoOptions=Kann die ganzzahlige Antwortoption nicht validieren, da keine option list bereitgestellt wird
Questionnaire_QR_Item_Missing=Keine Antwort für das erforderliche Element gefunden {0}
Questionnaire_QR_Item_NoCoding=Der Code {0}::{1} ist keine gültige Option.
Questionnaire_QR_Item_NoDate=Das Datum {0} ist keine gültige Option.
Questionnaire_QR_Item_NoInteger=Integer {0} ist keine gültige Option
Questionnaire_QR_Item_NoLinkId=Keine LinkId, kann also nicht validiert werden
Questionnaire_QR_Item_NoOptions=Optionen können nicht validiert werden, weil keine Option oder Optionen angeboten werden
Questionnaire_QR_Item_NoOptionsCoding=Optionsliste hat keine Optionswerte vom Typ Coding
Questionnaire_QR_Item_NoOptionsDate=Optionsliste hat keine Optionswerte vom Typ date
Questionnaire_QR_Item_NoOptionsInteger=Optionsliste hat keine Optionswerte vom Typ Integer
Questionnaire_QR_Item_NoOptionsString=Optionsliste hat keine Optionswerte vom Typ String
Questionnaire_QR_Item_NoOptionsTime=Optionsliste hat keine Optionswerte vom Typ time
Questionnaire_QR_Item_NoString=Der String {0} ist keine gültige Option
Questionnaire_QR_Item_NoTime=time {0} ist keine gültige Option
Questionnaire_QR_Item_NoType=Definition für Element {0} enthält keinen Typ
Questionnaire_QR_Item_NotEnabled=Item hat Antwort (2), auch wenn es nicht aktiviert ist {0}
Questionnaire_QR_Item_NotEnabled2=Item besitzt eine answer, auch wenn es nicht aktiviert ist (Element-ID = "{0}")
Questionnaire_QR_Item_NotFound=LinkId "{0}" im questionnaire nicht gefunden
Questionnaire_QR_Item_OnlyOneA=Nur ein Antwortelement mit dieser LinkId zulässig
Questionnaire_QR_Item_OnlyOneI=Nur ein Antwortelement mit dieser LinkId erlaubt - {0}
Questionnaire_QR_Item_Order=Struktureller Fehler: Elemente in falscher Reihenfolge
Questionnaire_QR_Item_StringNoOptions=String answer option kann nicht validiert werden, da keine Optionsliste bereitgestellt wird
Questionnaire_QR_Item_Text=Wenn Text vorhanden ist, muss er mit der Fragebogen-Definition für linkId {0} übereinstimmen.
Questionnaire_QR_Item_TimeNoOptions=Kann die time answer option nicht validieren, weil keine Optionsliste zur Verfügung steht
Questionnaire_QR_Item_WrongType=Answer value muss vom Typ {0} sein.
Questionnaire_QR_Item_WrongType2=Answer value muss einer der Typen {0} sein
Questionnaire_QR_Q_None=Es konnte kein passendes questionnaire identifiziert werden, so dass keine Validierung gegen den Basisfragebogen durchgeführt werden kann.
Questionnaire_QR_Q_NotFound=Der Fragebogen "{0}" konnte nicht gefunden werden, so dass keine Validierung gegen den Basisfragebogen durchgeführt werden kann.
Questionnaire_Q_EnableWhen_After=Das Ziel dieser enableWhen-Regel ({0}) kommt nach der Frage selbst
Questionnaire_Q_EnableWhen_IsInner=Fragen mit einem enableWhen können sich nicht auf eine innere Frage für ihren aktivierten enableWhen beziehen
Questionnaire_Q_EnableWhen_NoLink=Fragen mit einem enableWhen müssen einen Wert für den question link enthalten
Questionnaire_Q_EnableWhen_NoTarget=Ziel "{0}" für das enableWhen diese Frage konnte nicht gefunden werden
Questionnaire_Q_EnableWhen_Self=Ziel des enableWhen dieser Frage kann sich nicht selbst referenzieren
Reference_REF_Aggregation=Die Reference ist {0}, welche von dem angegebenen Aggregationsmodus für die Referenz nicht unterstützt wird.
Reference_REF_BadTargetType=Ungültiger Ressourcen-Zieltyp. Gefunden {0}, aber einen von ({1}) erwartet
Reference_REF_BadTargetType2=Der Typ "{0}", der durch die Referenz-URL {1} impliziert wird, ist kein gültiges Ziel für dieses Element (muss eines von {2} sein)
Reference_REF_CantMatchChoice=Es konnte kein passendes Profil für {0} unter den Auswahlmöglichkeiten [{1}] gefunden werden
Reference_REF_CantMatchType=Es konnte kein passendes Profil für {0} (nach Typ) unter den Auswahlmöglichkeiten [{1}] gefunden werden
Reference_REF_CantResolve=Ressource "{0}" nicht auffindbar
Reference_REF_CantResolveProfile=Der Profilbezug "{0}" konnte nicht aufgelöst werden.
Reference_REF_Format1=Relative URLs müssen das Format [ResourceName]/[id] haben, oder eine Such-ULR ist erlaubt ([type]?parameters. Gefunden {0})
Reference_REF_Format2=Relative URLs müssen das Format [ResourceName]/[id] haben. Gefunden {0}
Reference_REF_MultipleMatches=Es wurden mehrere übereinstimmende Profile für {0} unter den Auswahlmöglichkeiten gefunden: {1}
Reference_REF_NoDisplay=Eine Referenz ohne eine tatsächliche Referenz oder einen Identifikator sollte eine Displaywert haben
Reference_REF_NoType=Kann den Typ der Zielressource nicht bestimmen
Reference_REF_NotFound_Bundle=Bundled oder contained Referenz, welche nicht im Bundle/Ressource gefunden wurde {0}
Reference_REF_ResourceType=Passende Referenz für Referenz {0} hat resourceType {1}
Reference_REF_WrongTarget=Der Typ "{0}" ist kein gültiges Ziel für dieses Element (muss einer von {1} sein)
Resource_RES_ID_Missing=Die Ressource erfordert eine ID, aber es ist keine vorhanden
Resource_RES_ID_Prohibited=Die Ressource hat eine ID, aber keine ist erlaubt
Terminology_PassThrough_TX_Message = {0} for "{1}#{2}"
Terminology_TX_Binding_CantCheck = Binding by URI reference cannot be checked
Terminology_TX_Binding_Missing = Binding for {0} missing (cc)
Terminology_TX_Binding_Missing2 = Binding for {0} missing
Terminology_TX_Binding_NoServer = The value provided could not be validated in the absence of a terminology server
Terminology_TX_Binding_NoSource = Binding for path {0} has no source, so can''t be checked
Terminology_TX_Binding_NoSource2 = Binding has no source, so can''t be checked
Terminology_TX_Code_NotValid = Code {0} is not a valid code in code system {1}
Terminology_TX_Code_Unknown = Unknown Code ({0}#{1})
Terminology_TX_Code_ValueSet = No code provided, and a code is required from the value set {0} ({1})
Terminology_TX_Code_ValueSetMax = No code provided, and a code must be provided from the value set {0} (max value set {1})
Terminology_TX_Code_ValueSet_Ext = No code provided, and a code should be provided from the value set {0} ({1})
Terminology_TX_Coding_Count = Expected {0} but found {1} coding elements
Terminology_TX_Confirm_1 = Could not confirm that the codes provided are in the value set {0} and a code from this value set is required (class = {1})
Terminology_TX_Confirm_2 = Could not confirm that the codes provided are in the value set {0} and a code should come from this value set unless it has no suitable code (class = {1})
Terminology_TX_Confirm_3 = Could not confirm that the codes provided are in the value set {0} and a code is recommended to come from this value set (class = {1})
Terminology_TX_Confirm_4 = Could not confirm that the codes provided are in the value set {0}, and a code from this value set is required
Terminology_TX_Confirm_5 = Could not confirm that the codes provided are in the value set {0}, and a code should come from this value set unless it has no suitable code
Terminology_TX_Confirm_6 = Could not confirm that the codes provided are in the value set {0}, and a code is recommended to come from this value set
Terminology_TX_Display_Wrong = Display should be "{0}"
Terminology_TX_Error_CodeableConcept = Error {0} validating CodeableConcept
Terminology_TX_Error_CodeableConcept_Max = Error {0} validating CodeableConcept using maxValueSet
Terminology_TX_Error_Coding1 = Error {0} validating Coding
Terminology_TX_Error_Coding2 = Error {0} validating Coding: {1}
Terminology_TX_NoValid_1 = None of the codes provided are in the value set {0} ({1}, and a code from this value set is required) (codes = {2})
Terminology_TX_NoValid_10 = The code provided is not in the maximum value set {0} ({1}, and a code from this value set is required) (code = {2}#{3})
Terminology_TX_NoValid_11 = The code provided is not in the maximum value set {0} ({1}{2}
Terminology_TX_NoValid_12 = The Coding provided is not in the value set {0}, and a code is required from this value set. {1}
Terminology_TX_NoValid_13 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code. {1}
Terminology_TX_NoValid_14 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set. {1}
Terminology_TX_NoValid_15 = The value provided ("{0}") could not be validated in the absence of a terminology server
Terminology_TX_NoValid_16 = The value provided ("{0}") is not in the value set {1} ({2}, and a code is required from this value set){3}
Terminology_TX_NoValid_17 = The value provided ("{0}") is not in the value set {1} ({2}, and a code should come from this value set unless it has no suitable code){3}
Terminology_TX_NoValid_18 = The value provided ("{0}") is not in the value set {1} ({2}, and a code is recommended to come from this value set){3}
Terminology_TX_NoValid_2 = None of the codes provided are in the value set {0} ({1}, and a code should come from this value set unless it has no suitable code) (codes = {2})
Terminology_TX_NoValid_3 = None of the codes provided are in the value set {0} ({1}, and a code is recommended to come from this value set) (codes = {2})
Terminology_TX_NoValid_4 = The Coding provided is not in the value set {0}, and a code is required from this value set{1}
Terminology_TX_NoValid_5 = The Coding provided is not in the value set {0}, and a code should come from this value set unless it has no suitable code{1}
Terminology_TX_NoValid_6 = The Coding provided is not in the value set {0}, and a code is recommended to come from this value set{1}
Terminology_TX_NoValid_7 = None of the codes provided could be validated against the maximum value set {0} ({1}), (error = {2})
Terminology_TX_NoValid_8 = None of the codes provided are in the maximum value set {0} ({1}, and a code from this value set is required) (codes = {2})
Terminology_TX_NoValid_9 = The code provided could not be validated against the maximum value set {0} ({1}), (error = {2})
Terminology_TX_System_Invalid = Invalid System URI: {0}
Terminology_TX_System_NotKnown = Code System URI "{0}" is unknown so the code cannot be validated
Terminology_TX_System_Relative = Coding.system must be an absolute reference, not a local reference
Terminology_TX_System_Unknown = Unknown Code System "{0}"
Terminology_TX_System_ValueSet = Invalid System URI: {0} - cannot use a value set URI as a system
Terminology_TX_System_ValueSet2 = The Coding references a value set, not a code system ("{0}")
Terminology_TX_ValueSet_NotFound = ValueSet {0} not found by validator
Terminology_TX_Binding_CantCheck=Binding durch URI-Referenz kann nicht überprüft werden
Terminology_TX_Binding_Missing=Binding für {0} fehlt (cc)
Terminology_TX_Binding_Missing2=Binding für {0} fehlt
Terminology_TX_Binding_NoServer=Der angegebene Wert konnte in Ermangelung eines Terminologieservers nicht validiert werden
Terminology_TX_Binding_NoSource=Binding für Pfad {0} hat keine source, kann also nicht überprüft werden
Terminology_TX_Binding_NoSource2=Binding hat keine source, kann also nicht überprüft werden.
Terminology_TX_Code_NotValid=Code {0} ist kein gültiger Code im Codesystem {1}
Terminology_TX_Code_Unknown=Unbekannter Code ({0}#{1})
Terminology_TX_Code_ValueSet=Es wird kein Code gesetzt, und es ist ein Code aus ValueSet {0} ({1}) erforderlich
Terminology_TX_Code_ValueSetMax=Kein Code gesetzt, und es muss ein Code aus ValueSet {0} (max. Wertemenge {1}) gesetzt werden
Terminology_TX_Code_ValueSet_Ext=Kein Code gesetzt, und es sollte ein Code aus ValueSet{0} ({1}) gesetzt werden
Terminology_TX_Coding_Count=Erwartete {0}, aber gefundene {1} coding elements
Terminology_TX_Confirm_1=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind und ein Code aus diesem ValueSet ist erforderlich (class = {1})
Terminology_TX_Confirm_2=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind und ein Code aus diesem ValueSet stammen sollte. Es sei denn, es enthält keinen geeigneten Code (class = {1})
Terminology_TX_Confirm_3=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind, und es wird empfohlen einen Code aus diesem ValueSet zu verwenden (Klasse = {1})
Terminology_TX_Confirm_4=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind, und ein Code aus diesem ValueSet ist erforderlich
Terminology_TX_Confirm_5=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind, und ein Code sollte aus diesem ValueSet stammen. Es sei denn, er hat enthält keinen geeigneten Code
Terminology_TX_Confirm_6=Konnte nicht bestätigen, dass die angegebenen Codes im ValueSet {0} enthalten sind, und es wird empfohlen, einen Code aus diesem ValueSet zu verwenden.
Terminology_TX_Display_Wrong=Display sollte "{0}" sein
Terminology_TX_Error_CodeableConcept=Fehler {0} bei der Validierung des CodeableConcepts
Terminology_TX_Error_CodeableConcept_Max=Fehler {0} bei der Validierung des CodeableConcepts mit maxValueSet
Terminology_TX_Error_Coding1=Fehler {0} bei der Validierung des Coding
Terminology_TX_Error_Coding2=Fehler {0} bei der Validierung des Coding: {1}
Terminology_TX_NoValid_1=Keiner der bereitgestellten Codes ist im ValueSet {0} ({1}, und ein Code aus diesem ValueSet ist erforderlich) (Codes = {2})
Terminology_TX_NoValid_10=Der bereitgestellte Code ist nicht im maximum ValueSet {0} ({1}, und ein Code aus diesem ValueSet ist erforderlich) (Code = {2}#{3})
Terminology_TX_NoValid_11=Der bereitgestellte Code ist nicht im maximum value set {0} ({1}{2}
Terminology_TX_NoValid_12=Die angegebene Codierung ist nicht im ValueSet {0} enthalten, und es wird ein Code aus diesem ValueSet benötigt. {1}
Terminology_TX_NoValid_13=Die bereitgestellte Codierung ist nicht im ValueSet {0} enthalten, und ein Code sollte aus diesem ValueSet stammen, es sei denn, er hat enthält geeigneten Code. {1}
Terminology_TX_NoValid_14=Die angegebene Codierung ist nicht im ValueSet {0} enthalten, und es wird empfohlen, einen Code aus diesem ValueSet zu verwenden. {1}
Terminology_TX_NoValid_15=Der angegebene Wert ("{0}") konnte in Ermangelung eines Terminologieservers nicht validiert werden.
Terminology_TX_NoValid_16=Der angegebene Wert ("{0}") ist nicht im ValueSet {1} ({2}, und ein Code aus diesem Valueset ist erforderlich){3}
Terminology_TX_NoValid_17=Der angegebene Wert ("{0}") ist nicht im Valueset {1} ({2}, und ein Code sollte aus diesem Valueset stammen, es sei denn, er hat enthält geeigneten Code){3}
Terminology_TX_NoValid_18=Der angegebene Wert ("{0}") ist nicht im Valueset {1} ({2}, und es wird empfohlen, einen Code aus diesem Valueset zu verwenden){3}
Terminology_TX_NoValid_2=Keiner der angegebenen Codes ist im Valueset {0} ({1}, und ein Code sollte aus diesem Valueset stammen, es sei denn, er enthält keinen geeigneten Code) (Codes = {2})
Terminology_TX_NoValid_3=Keiner der angegebenen Codes ist im Valueset {0} ({1}, und es wird empfohlen, einen Code aus dieserm Valueset zu verwenden) (Codes = {2})
Terminology_TX_NoValid_4=Die bereitgestellte Codierung ist nicht im Valueset {0}, und es wird ein Code aus diesem Valueset benötigt{1}
Terminology_TX_NoValid_5=Die angegebene Codierung ist nicht im Valueset {0}, und ein Code sollte aus diesem Valueset stammen, es sei denn, er enthält keinen geeigneten Code{1}
Terminology_TX_NoValid_6=Die bereitgestellte Codierung ist nicht im Valueset {0} enthalten, und es wird empfohlen, einen Code aus diesem Valueset zu verwenden{1}
Terminology_TX_NoValid_7=Keiner der bereitgestellten Codes konnte gegen das maximum value set {0} ({1}) validiert werden, (Fehler = {2})
Terminology_TX_NoValid_8=Keiner der bereitgestellten Codes befindet sich im maximum value sete {0} ({1}, und ein Code aus diesem Valueset ist erforderlich) (Codes = {2})
Terminology_TX_NoValid_9=Der bereitgestellte Code konnte nicht gegen das the maximum value set {0} ({1}) validiert werden, (Fehler = {2})
Terminology_TX_System_Invalid=Ungültige System URI: {0}
Terminology_TX_System_NotKnown=Code System URI "{0}" ist unbekannt, so dass der Code nicht validiert werden kann
Terminology_TX_System_Relative=Coding.system muss eine absolute Referenz sein, nicht eine lokale Referenz
Terminology_TX_System_Unknown=Unbekanntes Code System "{0}"
Terminology_TX_System_ValueSet=Ungültige System-URI: {0} - kann kein ValueSet URI als System verwenden
Terminology_TX_System_ValueSet2=Die Codierung bezieht sich auf ein ValueSet, nicht auf ein Codesystem ("{0}").
Terminology_TX_ValueSet_NotFound=ValueSet {0} vom Validator nicht gefunden
Terminology_TX_ValueSet_NotFound2 = ValueSet {0} not found by validator
Type_Specific_Checks_DT_Base64_Valid = The value "{0}" is not a valid Base64 value
Type_Specific_Checks_DT_Boolean_Value = boolean values must be ''true'' or ''false''
Type_Specific_Checks_DT_Base64_Valid=Der Wert "{0}" ist kein gültiger Base64-Wert.
Type_Specific_Checks_DT_Boolean_Value=Boolesche Werte müssen ''wahr'' oder ''falsch'' sein.
Type_Specific_Checks_DT_Code_WS = The code "{0}" is not valid (whitespace rules)
Type_Specific_Checks_DT_DateTime_Reasonable = The value "{0}" is outside the range of reasonable years - check for data entry error
Type_Specific_Checks_DT_DateTime_Regex = The instant "{0}" is not valid (by regex)
Type_Specific_Checks_DT_DateTime_TZ = if a date has a time, it must have a timezone
Type_Specific_Checks_DT_DateTime_Valid = Not a valid date/time ({0})
Type_Specific_Checks_DT_Date_Valid = Not a valid date ({0})
Type_Specific_Checks_DT_Decimal_Range = The value "{0}" is outside the range of commonly/reasonably supported decimals
Type_Specific_Checks_DT_Decimal_Valid = The value "{0}" is not a valid decimal
Type_Specific_Checks_DT_ID_Valid = id value "{0}" is not valid
Type_Specific_Checks_DT_Identifier_System = Identifier.system must be an absolute reference, not a local reference
Type_Specific_Checks_DT_Instant_Valid = Not a valid instant ({0})
Type_Specific_Checks_DT_Integer64_Valid = The value "{0}" is not a valid integer64
Type_Specific_Checks_DT_Integer_GT = value is greater than permitted maximum value of {0}
Type_Specific_Checks_DT_Integer_LT = value is less than permitted minimum value of {0}
Type_Specific_Checks_DT_Integer_LT0 = value is less than permitted minimum value of 0
Type_Specific_Checks_DT_Integer_LT1 = value is less than permitted minimum value of 1
Type_Specific_Checks_DT_Integer_Valid = The value "{0}" is not a valid integer
Type_Specific_Checks_DT_OID_Start = OIDs must start with urn:oid:
Type_Specific_Checks_DT_OID_Valid = OIDs must be valid
Type_Specific_Checks_DT_Primitive_Length = value is longer than permitted maximum length of {0}
Type_Specific_Checks_DT_Primitive_NotEmpty = @value cannot be empty
Type_Specific_Checks_DT_Primitive_Regex = Element value "{0}" does not meet regex "{1}"
Type_Specific_Checks_DT_Primitive_ValueExt = Primitive types must have a value or must have child extensions
Type_Specific_Checks_DT_Primitive_WS = Primitive types should not only be whitespace
Type_Specific_Checks_DT_String_Length = value is longer than permitted maximum length of 1 MB (1048576 bytes)
Type_Specific_Checks_DT_String_WS = value should not start or finish with whitespace
Type_Specific_Checks_DT_Time_Valid = Not a valid time ({0})
Type_Specific_Checks_DT_URI_OID = URI values cannot start with oid:
Type_Specific_Checks_DT_URI_UUID = URI values cannot start with uuid:
Type_Specific_Checks_DT_URI_WS = URI values cannot have whitespace("{0}")
Type_Specific_Checks_DT_URL_Resolve = URL value "{0}" does not resolve
Type_Specific_Checks_DT_UUID_Strat = UUIDs must start with urn:uuid:
Type_Specific_Checks_DT_UUID_Vaid = UUIDs must be valid ({0})
Validation_BUNDLE_Message = The first entry in a message must be a MessageHeader
Validation_VAL_Content_Unknown = Unrecognised Content {0}
Validation_VAL_NoType = Unknown type {0}
Validation_VAL_Profile_MatchMultiple = Profile {0}, Element matches more than one slice - {1}, {2}
Validation_VAL_Profile_Maximum = {0}: max allowed = {1}, but found {2}
Validation_VAL_Profile_Minimum = {0}: minimum required = {1}, but only found {2}
Validation_VAL_Profile_MultipleMatches = Found multiple matching profiles among choices: {0}
Validation_VAL_Profile_NoCheckMax = {0}: Unable to check max allowed ({1}) due to lack of slicing validation
Validation_VAL_Profile_NoCheckMin = {0}": Unable to check minimum required ({1}) due to lack of slicing validation
Validation_VAL_Profile_NoDefinition = No definition found for resource type "{0}"
Validation_VAL_Profile_NoMatch = Unable to find matching profile among choices: {0}
Validation_VAL_Profile_NoSnapshot = StructureDefinition has no snapshot - validation is against the snapshot, so it must be provided
Validation_VAL_Profile_NoType = The type of element {0} is not known, which is illegal. Valid types at this point are {1}
Validation_VAL_Profile_NotAllowed = This element is not allowed by the profile {0}
Validation_VAL_Profile_NotSlice = This element does not match any known slice {0}
Validation_VAL_Profile_OutOfOrder = As specified by profile {0}, Element "{1}" is out of order
Validation_VAL_Profile_SliceOrder = As specified by profile {0}, Element "{1}" is out of order in ordered slice
Validation_VAL_Profile_Unknown = Profile reference "{0}" could not be resolved, so has not been checked
Validation_VAL_Profile_WrongType = Specified profile type was "{0}", but found type "{1}"
Validation_VAL_Unknown_Profile = Unknown profile {0}
XHTML_XHTML_Attribute_Illegal = Illegal attribute name in the XHTML ("{0}" on "{1}")
XHTML_XHTML_Element_Illegal = Illegal element name in the XHTML ("{0}")
XHTML_XHTML_NS_InValid = Wrong namespace on the XHTML ("{0}", should be "{1}")
XHTML_XHTML_Name_Invalid = Wrong name on the XHTML ("{0}") - must start with div
_DT_Fixed_Wrong = Value is "{0}" but must be "{1}"
All_observations_should_have_an_effectiveDateTime_or_an_effectivePeriod = All observations should have an effectiveDateTime or an effectivePeriod
All_observations_should_have_a_performer = All observations should have a performer
All_observations_should_have_a_subject = All observations should have a subject
Unable_to_resolve_slice_matching__no_fixed_value_or_required_value_set = Unable to resolve slice matching - no fixed value or required value set
Unable_to_resolve_slice_matching__slice_matching_by_value_set_not_done = Unable to resolve slice matching - slice matching by value set not done
Problem_processing_expression__in_profile__path__ = Problem processing expression {0} in profile {1} path {2}: {3}
Unable_to_find_element_with_id_ = Unable to find element with id "{0}"
Slice_encountered_midway_through_set_path___id___ = Slice encountered midway through set (path = {0}, id = {1}); {2}
Unable_to_resolve_actual_type_ = Unable to resolve actual type {0}
Unsupported_version_R1 = Unsupported version R1
Unsupported_fixed_value_type_for_discriminator_for_slice__ = Unsupported fixed value type for discriminator({0}) for slice {1}: {2}
Unsupported_CodeableConcept_pattern__extensions_are_not_allowed__for_discriminator_for_slice_ = Unsupported CodeableConcept pattern - extensions are not allowed - for discriminator({0}) for slice {1}
Unsupported_CodeableConcept_pattern__must_have_at_least_one_coding__for_discriminator_for_slice_ = Unsupported CodeableConcept pattern - must have at least one coding - for discriminator({0}) for slice {1}
Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_ = Unsupported CodeableConcept pattern - using text - for discriminator({0}) for slice {1}
Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_ = Unsupported Identifier pattern - extensions are not allowed - for discriminator({0}) for slice {1}
Unsupported_fixed_pattern_type_for_discriminator_for_slice__ = Unsupported fixed pattern type for discriminator({0}) for slice {1}: {2}
Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___ = Problem evaluating slicing expression for element in profile {0} path {1} (fhirPath = {2}): {3}
Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions = Could not match discriminator ({0}) for slice {1} in profile {2} - the discriminator {3} does not have fixed value, binding or existence assertions
Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions = Could not match any discriminators ({0}) for slice {1} in profile {2} - None of the discriminator {3} have fixed value, binding or existence assertions
Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0 = Discriminator ({0}) is based on element existence, but slice {1} neither sets min>=1 or max=0
Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_ = Profile based discriminators must have a type with a profile ({0} in profile {1})
Profile_based_discriminators_must_have_only_one_type__in_profile_ = Profile based discriminators must have only one type ({0} in profile {1})
Profile_based_discriminators_must_have_a_type__in_profile_ = Profile based discriminators must have a type ({0} in profile {1})
Discriminator__is_based_on_type_but_slice__in__has_no_types = Discriminator ({0}) is based on type, but slice {1} in {2} has no types
Discriminator__is_based_on_type_but_slice__in__has_multiple_types_ = Discriminator ({0}) is based on type, but slice {1} in {2} has multiple types: {3}
Found__items_for__resolving_discriminator__from_ = Found {0} items for {1} resolving discriminator {2} from {3}
Unable_to_find__resolving_discriminator__from_ = Unable to find {0} resolving discriminator {1} from {2}
Unable_to_find_resource__at__resolving_discriminator__from_ = Unable to find resource {0} at {1} resolving discriminator {2} from {3}
No_reference_resolving_discriminator__from_ = No reference resolving discriminator {0} from {1}
Unable_to_resolve_element__in_profile_ = Unable to resolve element {0} in profile {1}
Unable_to_resolve_profile_ = Unable to resolve profile {0}
Resource_resolution_services_not_provided = Resource resolution services not provided
Unrecognised_extension_context_ = Unrecognised extension context {0}
Unable_to_locate_the_profile__in_order_to_validate_against_it = Unable to locate the profile "{0}" in order to validate against it
Reference__refers_to_a__not_a_ValueSet = Reference {0} refers to a {1} not a ValueSet
Not_done_yet_ValidatorHostServicesconformsToProfile_when_item_is_not_an_element = Not done yet (ValidatorHostServices.conformsToProfile), when item is not an element
Not_supported_yet = Not supported yet
Unable_to_resolve_ = Unable to resolve {0}
Not_done_yet__resolve__locally_2 = Not done yet - resolve {0} locally (2)
Not_done_yet_ValidatorHostServicesexecuteFunction = Not done yet (ValidatorHostServices.executeFunction)
Not_done_yet_ValidatorHostServicescheckFunction = Not done yet (ValidatorHostServices.checkFunction)
Not_done_yet_ValidatorHostServicesresolveFunction_ = Not done yet (ValidatorHostServices.resolveFunction): {0}
Type_Specific_Checks_DT_DateTime_Reasonable=Der Wert "{0}" liegt außerhalb des Bereichs vernünftiger Jahre - Prüfung auf Dateneingabefehler
Type_Specific_Checks_DT_DateTime_Regex=Instant "{0}" ist nicht gültig (per Regex)
Type_Specific_Checks_DT_DateTime_TZ=Wenn ein Datum eine Uhrzeit hat, muss es eine Zeitzone haben.
Type_Specific_Checks_DT_DateTime_Valid=Kein gültiges Datum/Uhrzeit ({0})
Type_Specific_Checks_DT_Date_Valid=Kein gültiges Datum ({0})
Type_Specific_Checks_DT_Decimal_Range=Der Wert "{0}" liegt außerhalb des Bereichs der üblicherweise/vernünftig unterstützten Dezimalzahlen.
Type_Specific_Checks_DT_Decimal_Valid=Der Wert "{0}" ist kein gültiger Dezimalwert.
Type_Specific_Checks_DT_ID_Valid=id-Wert "{0}" ist nicht gültig
Type_Specific_Checks_DT_Identifier_System=Identifier.system muss eine absolute Referenz sein, nicht eine lokale Referenz
Type_Specific_Checks_DT_Instant_Valid=Ungültige Instant ({0})
Type_Specific_Checks_DT_Integer64_Valid=Der Wert "{0}" ist keine gültige integer64
Type_Specific_Checks_DT_Integer_GT=Wert größer als der zulässige Maximalwert von {0}
Type_Specific_Checks_DT_Integer_LT=Wert ist kleiner als der zulässige Mindestwert von {0}
Type_Specific_Checks_DT_Integer_LT0=Wert ist kleiner als der zulässige Mindestwert von 0
Type_Specific_Checks_DT_Integer_LT1=Wert kleiner ist als der zulässige Mindestwert von 1
Type_Specific_Checks_DT_Integer_Valid=Der Wert "{0}" ist keine gültige ganze Zahl.
Type_Specific_Checks_DT_OID_Start=OIDs müssen mit urn:oid: beginnen
Type_Specific_Checks_DT_OID_Valid=OIDs müssen gültig sein
Type_Specific_Checks_DT_Primitive_Length=Wert länger als die zulässige Maximallänge von {0}
Type_Specific_Checks_DT_Primitive_NotEmpty=@value kann nicht leer sein
Type_Specific_Checks_DT_Primitive_Regex=Elementwert "{0}" entspricht nicht der Regex "{1}".
Type_Specific_Checks_DT_Primitive_ValueExt=Primitive Typen müssen einen Wert, oder child Extensions haben
Type_Specific_Checks_DT_Primitive_WS=Primitive Typen sollten nicht nur aus Leerzeichen bestehen
Type_Specific_Checks_DT_String_Length=Wert ist länger als die zulässige Maximallänge von 1 MB (1048576 Bytes)
Type_Specific_Checks_DT_String_WS=Wert sollte nicht mit Leerzeichen beginnen oder enden
Type_Specific_Checks_DT_Time_Valid=Keine gültige Zeit ({0})
Type_Specific_Checks_DT_URI_OID=URI-Werte können nicht mit oid: beginnen
Type_Specific_Checks_DT_URI_UUID=URI-Werte können nicht mit uuid: beginnen
Type_Specific_Checks_DT_URI_WS=URI-Werte können keine Leerzeichen enthalten ("{0}")
Type_Specific_Checks_DT_URL_Resolve=URL-Wert "{0}" löst nicht auf
Type_Specific_Checks_DT_UUID_Strat=UUIDs müssen mit urn:uuid: beginnen
Type_Specific_Checks_DT_UUID_Vaid=UUIDs müssen gültig sein ({0})
Validation_BUNDLE_Message=Der erste Eintrag in einer Nachricht muss ein MessageHeader sein
Validation_VAL_Content_Unknown=Unerkannter Inhalt {0}
Validation_VAL_NoType=Unbekannter Typ {0}
Validation_VAL_Profile_MatchMultiple=Profil {0}, Element stimmt mit mehr als einem Slice überein - {1}, {2}
Validation_VAL_Profile_Maximum={0}: maximal erlaubt = {1}, aber gefunden {2}
Validation_VAL_Profile_Minimum={0}: mindestens erforderlich = {1}, aber nur gefunden {2}
Validation_VAL_Profile_MultipleMatches=Es wurden mehrere passende Profile unter den Auswahlmöglichkeiten gefunden: {0}
Validation_VAL_Profile_NoCheckMax={0}: Kann die maximal zulässige Anzahl ({1}) aufgrund fehlender Slicing-Validierung nicht überprüfen.
Validation_VAL_Profile_NoCheckMin={0}": Kann das erforderliche Minimum ({1}) aufgrund fehlender Slicing-Validierung nicht überprüfen
Validation_VAL_Profile_NoDefinition=Keine Definition für Ressourcentyp "{0}" gefunden
Validation_VAL_Profile_NoMatch=Es ist nicht möglich, ein passendes Profil unter den Kandidaten zu finden: {0}
Validation_VAL_Profile_NoSnapshot=StructureDefinition hat keinen Snapshot - die Validierung erfolgt gegen den Snapshot, daher muss dieser bereitgestellt werden
Validation_VAL_Profile_NoType=Der Typ des Elements {0} ist nicht bekannt, was illegal ist. Gültige Typen an dieser Stelle sind {1}
Validation_VAL_Profile_NotAllowed=Dieses Element wird durch das Profil {0} nicht erlaubt.
Validation_VAL_Profile_NotSlice=Dieses Element stimmt mit keinem bekannten Slice {0} überein, und das Slicing ist CLOSED: {1}
Validation_VAL_Profile_OutOfOrder=Durch das Profil {0} angegeben, ist das Element "{1}" außerhalb der definierten Reihenfolge.
Validation_VAL_Profile_SliceOrder=Durch das Profil {0} spezifiziert, ist das Element "{1}" an der falschen Stelle im ordered slicee enthalten
Validation_VAL_Profile_Unknown=Profil Reference "{0}" konnte nicht aufgelöst werden, wurde also nicht überprüft
Validation_VAL_Profile_WrongType=Angegebener Profiltyp war "{0}", aber gefundener Typ "{1}".
Validation_VAL_Unknown_Profile=Unbekanntes Profil {0}
XHTML_XHTML_Attribute_Illegal=Unzulässiger Attributname in XHTML ("{0}" auf "{1}")
XHTML_XHTML_Element_Illegal=Unzulässiger Elementname im XHTML ("{0}")
XHTML_XHTML_NS_InValid=Falscher Namensraum im XHTML ("{0}", sollte "{1}" sein)
XHTML_XHTML_Name_Invalid=Falscher Name im XHTML ("{0}") - muss mit div beginnen
_DT_Fixed_Wrong=Der Wert ist "{0}", muss aber "{1}" sein.
All_observations_should_have_an_effectiveDateTime_or_an_effectivePeriod=Alle Observations sollten ein effectiveDateTime oder eine effectivePeriode haben
All_observations_should_have_a_performer=Alle Observations sollten einen Performer haben
All_observations_should_have_a_subject=Alle Observations sollten ein Subject haben
Unable_to_resolve_slice_matching__no_fixed_value_or_required_value_set=Slice-Matching kann nicht aufgelöst werden - kein fester Wert oder erforderliches ValueSet
Unable_to_resolve_slice_matching__slice_matching_by_value_set_not_done=Slice-Matching kann nicht aufgelöst werden - Slice-Matching nach ValueSet nicht implementiert
Problem_processing_expression__in_profile__path__=Problem bei der Verarbeitung der Expression {0} im Profil {1} Pfad {2}: {3}
Unable_to_find_element_with_id_=Element mit der Id "{0}" konnte nicht gefunden werden
Slice_encountered_midway_through_set_path___id___=Slice, der in der Mitte des Set gefunden wurde (Pfad = {0}, id = {1}); {2}
Unable_to_resolve_actual_type_=Kann den tatsächlichen Typ nicht auflösen {0}
Unsupported_version_R1=Nicht unterstützte Version R1
Unsupported_fixed_value_type_for_discriminator_for_slice__=Nicht unterstützter fixed value type für Diskriminator({0}) für Slice {1}: {2}
Unsupported_CodeableConcept_pattern__extensions_are_not_allowed__for_discriminator_for_slice_=Nicht unterstütztes CodeableConcept Pattern - Extensions sind nicht zulässig - für Diskriminator({0}) für Slice {1}
Unsupported_CodeableConcept_pattern__must_have_at_least_one_coding__for_discriminator_for_slice_=Nicht unterstütztes CodeableConcept Pattern - muss mindestens eine Coding haben - für Diskriminator({0}) für Slice {1}
Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_=Nicht unterstütztes CodeableConcept Pattern - unter Verwendung von Text - für Diskriminator({0}) für Scheibe {1}
Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_=Nicht unterstütztes Identifier Pattern - Extensions sind nicht erlaubt - für Diskriminator({0}) für Slice {1}
Unsupported_fixed_pattern_type_for_discriminator_for_slice__=Nicht unterstützter fixed Pattern Type für Diskriminator({0}) für Slice {1}: {2}
Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___=Problem bei der Auswertung des Slicing-Ausdrucks für Element im Profil {0} Pfad {1} (fhirPfad = {2}): {3}
Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions=Konnte nicht mit dem Diskriminator ({0}) für Slice {1} in Profil {2} übereinstimmen - der Diskriminator {3} hat keinen fixed Value, kein Binding oder existence assertions
Could_not_match_any_discriminators__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions=Konnte keinen Diskriminator ({0}) für Slice {1} im Profil {2} zuordnen - Keiner der Diskriminatoren {3} hat einen fixed value, eine Binding oder existence assertions
Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0=Der Diskriminator ({0}) basiert auf der Existenz von Elementen, aber Slice {1} setzt weder min>=1 noch max=0
Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_=Profilbasierte Diskriminatoren müssen einen Typ mit einem Profil ({0} im Profil {1}) haben.
Profile_based_discriminators_must_have_only_one_type__in_profile_=Profilbasierte Diskriminatoren dürfen nur einen Typ ({0} im Profil {1}) haben.
Profile_based_discriminators_must_have_a_type__in_profile_=Profilbasierte Diskriminatoren müssen einen Typ ({0} im Profil {1}) haben.
Discriminator__is_based_on_type_but_slice__in__has_no_types=Der Diskriminator ({0}) basiert auf dem Typ, aber das Slice {1} in {2} hat keine Typen
Discriminator__is_based_on_type_but_slice__in__has_multiple_types_=Der Diskriminator ({0}) basiert auf dem Typ, aber das Slice {1} in {2} hat mehrere Typen: {3}
Found__items_for__resolving_discriminator__from_={0} Elemente für {1} gefunden welche mit Diskriminators {2} von {3} übereinstimmen
Unable_to_find__resolving_discriminator__from_=Kann keinen {0} auflösenden Diskriminator {1} von {2} finden
Unable_to_find_resource__at__resolving_discriminator__from_=Ressource {0} bei {1} nicht auffindbar, Diskriminator {2} von {3}
No_reference_resolving_discriminator__from_=Kein Auflösen der Referenz möglich, Diskriminator {0} von {1}
Unable_to_resolve_element__in_profile_=Element {0} im Profil {1} kann nicht aufgelöst werden
Unable_to_resolve_profile_=Profil {0} kann nicht gefunden werden
Resource_resolution_services_not_provided=Dienste zur Ressourcenauflösung werden nicht verfügbar
Unrecognised_extension_context_=Unerkannter Erweiterungskontext {0}
Unable_to_locate_the_profile__in_order_to_validate_against_it=Das Profil "{0}" konnte nicht gefunden werden um gegen dieses validieren zu können
Reference__refers_to_a__not_a_ValueSet=Die Referenz {0} referenziert auf {1}, nicht auf ein ValueSet
Not_done_yet_ValidatorHostServicesconformsToProfile_when_item_is_not_an_element=Not done yet (ValidatorHostServices.conformsToProfile), wenn das Element kein Element ist
Not_supported_yet=Noch nicht unterstützt
Unable_to_resolve_=Nicht auflösbar {0}
Not_done_yet__resolve__locally_2=Noch nicht unterstützt - find {0} lokal (2)
Not_done_yet_ValidatorHostServicesexecuteFunction=Noch nicht unterstützt (ValidatorHostServices.executeFunction)
Not_done_yet_ValidatorHostServicescheckFunction=Noch nicht unterstützt (ValidatorHostServices.checkFunction)
Not_done_yet_ValidatorHostServicesresolveFunction_=Noch nicht unterstützt (ValidatorHostServices.resolveFunction): {0}
Unable_to_find_base_definition_for_logical_model__from_=Es konnte keine base definition für das logical model gefunden werden: {0} von {1}
Same_id_on_multiple_elements__in_=Gleiche Id ''{0}'' bei mehreren Elementen {1}/{2} in {3}
No_path_on_element_Definition__in_=Kein Pfad auf Element Definition {0} in {1}
needs_a_snapshot=benötigt einen Snapshot
not_the_right_kind_of_structure_to_generate_schematrons_for=nicht die richtige Art von Struktur zur Erzeugung von Schematrons
Not_handled_yet_sortElements_=Noch nicht unterstützt (sortElemente: {0}:{1})
Unable_to_resolve_profile__in_element_=Profil {0} im Element {1} kann nicht aufgelöst werden
Cant_have_children_on_an_element_with_a_polymorphic_type__you_must_slice_and_constrain_the_types_first_sortElements_=Kinder auf einem Element mit einem polymorphen Typ sind nicht erlaubt - Sie müssen die Typen zuerst slicen und constrainen (sortElemente: {0}:{1})
Unable_to_find_profile__at_=Das Profil ''{0}'' konnte bei {1} nicht gefunden werden.
Unhandled_situation_resource_is_profiled_to_more_than_one_option__cannot_sort_profile=Ungeklärte Situation: Ressource ist für mehr als eine Option profiliert - kann das passende Profil nicht bestimmen
Internal_recursion_detection_find_loop_path_recursion____check_paths_are_valid_for_path_=Interne Rekursionserkennung: find()-Schleifenpfadrekursion > {0} - Prüfpfade sind gültig (für Pfad {1}/{2})
Internal_error___type_not_known_=Interner Fehler - Typ nicht bekannt {0}
Unable_to_find_element_=Element {0} kann nicht gefunden werden
Error_generating_table_for_profile__=Fehler bei der Erstelleung der Tabelle für das Profil {0}: {1}
StructureDefinition__at__illegal_constrained_type__from__in_=StructureDefinition {0} bei {1}: unzulässiger eingeschränkter Typ {2} von {3} bis {4}
Error_at__The_target_profile__is_not__valid_constraint_on_the_base_=Fehler bei {0}#{1}: Das Zielprofil {2} ist keine gültiges constrain auf die Basis ({3})
Error_in_profile__at__Base_isSummary___derived_isSummary__=Fehler im Profil {0} bei {1}: Basis isSummary = {2}, derived isSummary = {3}
StructureDefinition__at__illegal_attempt_to_change_a_binding_from__to_=StructureDefinition {0} bei {1}: illegaler Versuch ein Binding von {2} auf {3} zu ändern
Unexpected_condition_in_differential_typeslicetypelistsize__1_at_=Unerwartete condition im Differential: typ-slice.typ-list.size() != 1 bei {0}/{1}
Unexpected_condition_in_differential_typeslicetypelistsize__10_and_implicit_slice_name_does_not_contain_a_valid_type__at_=Unerwartete condition in Differential: type-slice.type-list.size() == 10 und impliziter Slice-Name enthält keinen gültigen Typ (''{0}''?) bei {1}/{2}
Attempt_to_use_a_snapshot_on_profile__as__before_it_is_generated=Versuch einen Schnappschuss für das Profil ''{0}'' als {1} zu verwenden, bevor er generiert wird
null_min = null min
_has_children__for_type__in_profile__but_cant_find_type={0} hat children ({1}) für den Typ {2} im Profil {3}, kann aber den Typ nicht finden
_has_children__and_multiple_types__in_profile_={0} hat children ({1}) und mehrere Typen ({2}) im Profil {3}
Adding_wrong_path=Falschen Pfad hinzufügen
Named_items_are_out_of_order_in_the_slice=Named items sind in der Slice im falscher Reihenfolge
The_base_snapshot_marks_a_slicing_as_closed_but_the_differential_tries_to_extend_it_in__at__=Der base snapshot markiert ein Slicing als closed, aber das Differential versucht, es in {0} bei {1} ({2}) zu erweitern.
Not_done_yet=Noch nicht unterstützt
Unknown_type__at_=Unbekannter Typ {0} bei {1}
Differential_walks_into____but_the_base_does_not_and_there_is_not_a_single_fixed_type_The_type_is__This_is_not_handled_yet=Differential beinhaltet ''{0} (@ {1})'', aber die Base nicht, und ist fixed type gesetzt. Der Typ ist {2}. Dies wird noch nicht unterstützt.
Slicing_rules_on_differential__do_not_match_those_on_base___rule___=Slicing-Regeln auf Differential ({0}) stimmen nicht mit denen auf Basis ({1}) überein - Regel @ {2} ({3})
Slicing_rules_on_differential__do_not_match_those_on_base___disciminator___=Slicing-Regeln auf Differential ({0}) stimmen nicht mit denen auf Basis ({1}) überein - Diskriminator @ {2} ({3})
Slicing_rules_on_differential__do_not_match_those_on_base___order___=Slicing-Regeln für Differential ({0}) stimmen nicht mit denen der Basis ({1}) überein - Reihenfolge @ {2} ({3})
not_done_yet__slicing__types__=noch nicht unterstützt - slicing / typen @ {0}
Invalid_slicing__there_is_more_than_one_type_slice_at__but_one_of_them__has_min__1_so_the_other_slices_cannot_exist=Ungültiges Slicing: Es gibt mehr als einen Typ Slice bei {0}, aber einer von ihnen ({1}) hat min = 1, so dass die anderen Slices nicht existieren können.
Did_not_find_type_root_=\ type root: {0} konnte nicht gefunden werden
Error_at_path__Slice_for_type__has_wrong_type_=Fehler bei Pfad {0}: Slice für Typ ''{1}'' hat falschen Typ ''{2}''
Error_at_path__Slice_for_type__has_more_than_one_type_=Fehler bei Pfad {0}: Slice für Typ '{1}' hat mehr als einen Typ '{2}'.
Error_at_path__Slice_name_must_be__but_is_=Fehler bei Pfad {0}: Slice-Name muss ''{1}'' sein, ist aber ''{2}''
Error_at_path__in__Type_slicing_with_slicingdiscriminatorpath__this=Fehler bei Pfad {0} in {1}: Typ-Slicing mit slicing.discriminator.path != ''$this''
Error_at_path__in__Type_slicing_with_slicingdiscriminatortype__type=Fehler bei Pfad {0} in {1}: Typ-Slicing mit slicing.discriminator.type != ''typ''
Error_at_path__in__Type_slicing_with_slicingdiscriminatorcount__1=Fehler bei Pfad {0} in {1}: Typ-Slicing mit slicing.discriminator.count() > 1
Error_at_path__in__Type_slicing_with_slicingordered__true=Fehler bei Pfad {0} in {1}: Typ Slicing mit slicing.ordered = true
Adding_wrong_path_in_profile___vs_=Falscher Pfad im Profil hinzugefügt {0}: {1} vs {2}
_has_no_children__and_no_types_in_profile_={0} hat keine Kinder ({1}) und keine Typen im Profil {2}
not_done_yet=noch nicht unterstützt
Did_not_find_single_slice_=Keine Slice gefunden: {0}
Differential_does_not_have_a_slice__b_of_____in_profile_=Das Differential hat kein Slice: {0}/ (b:{1} von {2} / {3}/ {4}) im Profil {5}
Attempt_to_a_slice_an_element_that_does_not_repeat__from__in_=Versuch ein Element zu sclicen, das sich nicht wiederholt: {0}/{1} von {2} in {3}
Unable_to_resolve_reference_to_=Kann den Verweis auf {0} nicht auflösen
Unable_to_find_element__in_=Element {0} in {1} konnte nicht gefunden werden
Unable_to_find_base__for_=Basis {0} für {1} konnte nicht gefunden werden
Adding_wrong_path__outcomegetPath___resultPathBase__=Falscher Pfad hinzugefügt - outcome.getPath() = {0}, resultPathBase = {1}
Illegal_path__in_differential_in__illegal_characters_=Unzulässiger Pfad ''{0}'' in Differential in {1}: unzulässige Zeichen []
Illegal_path__in_differential_in__illegal_character_=Illegaler Pfad ''{0}'' in Differential in {1}: illegales Zeichen ''{2}''
Illegal_path__in_differential_in__no_unicode_whitespace=Illegaler Pfad ''{0}'' in Differential in {1}: kein Unicode-Whitespace erlaubt
Illegal_path__in_differential_in__name_portion_exceeds_64_chars_in_length=Unzulässiger Pfad ''{0}'' in Differential in {1}: Namensteil überschreitet 64 Zeichen Länge
Illegal_path__in_differential_in__name_portion_mising_=Unzulässiger Pfad ''{0}'' in Differential in {1}: Namensteil fehlt (''...'')
Illegal_path__in_differential_in__must_start_with_=Illegaler Pfad ''{0}'' in Differential in {1}: muss mit {2}.{3} beginnen
No_path_value_on_element_in_differential_in_=Kein Pfadwert auf Element in Differential in {0}
No_path_on_element_in_differential_in_=Kein Pfad auf Element in Differential in {0}
Unxpected_internal_condition__no_source_on_diff_element=Unerwarteter interner Zustand - keine Source auf dem diff-Element definiert
type_on_first_snapshot_element_for__in__from_=type des ersten snapshot elements definiert für {0} in {1} von {2}
type_on_first_differential_element=type des ersten differential elements definiert!
Circular_snapshot_references_detected_cannot_generate_snapshot_stack__=Zirkuläre Snapshot-Referenzen erkannt; kann keinen Snapshot erzeugen (Stapel = {0})
Base__Derived_profiles_have_different_types____vs___=Basis- und abgeleitete Profile haben unterschiedliche Typen ({0} = {1} vs. {2} = {3})
Derived_profile__has_no_derivation_value_and_so_cant_be_processed=Das abgeleitete Profil {0} besitzt keinen derivation value und kann daher nicht verarbeitet werden.
Derived_profile__has_no_type=Abgeleitetes Profil {0} hat keinen Typ
Base_profile__has_no_type=Das Basisprofil {0} hat keinen Typ
no_derived_structure_provided=keine abgeleitete Struktur vorhanden.
no_base_profile_provided=kein Basisprofil vorhanden
element_id__null__on_ = element id = null: {0} on {1}
element__null_ = element = null: {0}
getSliceList_should_only_be_called_when_the_element_has_slicing=getSliceList sollte nur aufgerufen werden, wenn das Element Slicing hat
Unable_to_resolve_name_reference__at_path_=Name reference {0} am Pfad {1} kann nicht aufgelöst werden
Details_for__matching_against_Profile_=Details für {0} Abgleich gegen Profil{1}
Does_not_match_slice_=Stimmt nicht mit Slice "{0}" überein
Profile__does_not_match_for__because_of_the_following_profile_issues__=Das Profil {0} passt nicht zu {1} wegen der folgenden Profilprobleme: {2}
This_element_does_not_match_any_known_slice_=Dieses Element stimmt mit keinem bekannten Slice{0} überein.
defined_in_the_profile=im Profil definiert
This_does_not_appear_to_be_a_FHIR_resource_unknown_name_=Dies scheint keine FHIR-Ressource zu sein (unbekannter Name "{0}")
This_cannot_be_parsed_as_a_FHIR_object_no_name=Dies kann nicht als FHIR-Objekt geparst werden (kein Name)
This_does_not_appear_to_be_a_FHIR_resource_unknown_namespacename_=Dies scheint keine FHIR-Ressource zu sein (unbekannter Namensraum/Name "{0}::{1}")
This__cannot_be_parsed_as_a_FHIR_object_no_namespace=Dieses "{0}2 kann nicht als FHIR-Objekt geparst werden (kein Namensraum).
Unable_to_find_resourceType_property=ResourceType-Property kann nicht gefunden werden
Error_parsing_JSON_the_primitive_value_must_be_a_string=Fehler beim Parsen von JSON: Der primitive Wert muss ein String sein.
Error_parsing_JSON_the_primitive_value_must_be_a_number=Fehler beim Parsen von JSON: Der primitive Wert muss eine Zahl sein.
Error_parsing_JSON_the_primitive_value_must_be_a_boolean=Fehler beim Parsen von JSON: Der primitive Wert muss ein Boolean sein.
Error_parsing_XHTML_=Fehler beim Parsen von XHTML: {0}
This_property_must_be_an_object_not_=Dieses Property muss ein Objekt sein, nicht {0}
This_property_must_be_an_simple_value_not_=Diese Property muss ein einfacher Wert sein, nicht {0}
This_property_must_be__not_=Diese Property muss {0}, nicht {1} sein
This_property_must_be_an_Array_not_=Diese Eigenschaft muss ein Array sein, nicht {0}
Unrecognised_property_=Nicht erkannte Property ''@{0}''
Object_must_have_some_content=Objekt muss einen Inhalt haben
Error_parsing_JSON_=Fehler beim Parsen von JSON: {0}
Node_type__is_not_allowed=Nodetyp {0} ist nicht erlaubt
CDATA_is_not_allowed=CDATA ist nicht erlaubt
Undefined_element_=Undefiniertes Element ''{0}''
Undefined_attribute__on__for_type__properties__=Undefiniertes Attribut ''@{0}'' auf {1} für Typ {2} (properties = {3})
Text_should_not_be_present=Text sollte nicht vorhanden sein
Wrong_namespace__expected_=Falscher Namensraum - erwartet ''{0}''
Element_must_have_some_content=Element muss einen Inhalt haben
No_processing_instructions_allowed_in_resources=Keine Verarbeitungsanweisungen in Ressourcen erlaubt
Unknown_resource_type_missing_rdfstype=Unbekannter Ressourcentyp (fehlender rdfs:typ)
reference_to__cannot_be_resolved=Referenz auf {0} kann nicht aufgelöst werden
This_property_must_be_a_URI_or_bnode_not_a_=Diese Property muss ein URI oder bnode sein, nicht ein {0}
This_property_must_be_a_Literal_not_a_=Diese Property muss ein Literal sein, nicht ein {0}
Unrecognised_predicate_=Nicht anerkanntes predicate ''{0}''
Error_parsing_Turtle_=Fehler beim Parsen von Turtle: {0}
Unexpected_datatype_for_rdfstype=Unerwarteter Datentyp für rdfs:type
Attempt_to_replace_element_name_for_a_nonchoice_type=Versuch, den Elementnamen für einen non-choice type zu ersetzen
Wrong_type_for_resource=Falscher Typ für Ressource
Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_=Enthaltene Ressource scheint keine FHIR-Ressource zu sein (unbekannter Name ''{0}'')
Unknown_Date_format_=Unbekanntes Datumsformat ''{0}''
Unknown_Data_format_=Unbekanntes Datenformat ''{0}''
No_type_found_on_=Kein Typ gefunden bei ''{0}''
error_writing_number__to_JSON=Fehler beim Schreiben der Nummer ''{0}'' in JSON
Unable_to_process_request_for_resource_for___=Anforderung einer Ressource für {0} / {1} kann nicht verarbeitet werden
Resource_type_mismatch_for___=Ressourcentyp-Abweichung für {0} / {1}
not_done_yet_cant_fetch_=noch nicht implementiert: kann {0} nicht auflösen
Attempt_to_use_Terminology_server_when_no_Terminology_server_is_available=Versuch den Terminologieserver zu verwenden, wenn kein Terminologieserver verfügbar ist
No_ExpansionProfile_provided=Kein Expansionsprofil verfügbar
Can_only_specify_profile_in_the_context=Kann Profil nur im Kontext angeben
no_url_in_expand_value_set_2=keine Url im expand value set 2
no_url_in_expand_value_set=keine Url im expand value set
no_value_set=kein value set
No_Parameters_provided_to_expandVS=Keine Parameter für expandVS angegeben
No_Expansion_Parameters_provided=Keine Expansion-Parameter angegeben
Unable_to_resolve_value_Set_=ValueSet {0} kann nicht gefunden werden
Delimited_versions_have_exact_match_for_delimiter____vs_=Delimited Versionen haben eine genaue Übereinstimmung für das Trennzeichen ''{0}'' : {1} vs {2}
Duplicate_Resource_=Ressource duplizieren {0}
Error_expanding_ValueSet_running_without_terminology_services=Fehler bei der Erweiterung von ValueSet: Betrieb ohne Terminologiedienste
Error_validating_code_running_without_terminology_services=Fehler beim Validieren des Codes: Ausführung ohne Terminologiedienste
Unable_to_validate_code_without_using_server=Code kann ohne Verwendung des Servers nicht validiert werden
Profile___Error_generating_snapshot=Profil {0} ({1}). Fehler bei der Erstellung des Snapshots
Profile___element__Error_generating_snapshot_=Profil {0} ({1}). Fehler bei der Erstellung des Snapshots
Profile___base__could_not_be_resolved=Profil {0} ({1}) base {2} konnte nicht aufgelöst werden
Profile___has_no_base_and_no_snapshot=Profil {0} ({1}) hat keine base und keinen SnapShot
No_validator_configured=Kein Validator konfiguriert
Parser_Type__not_supported=Parser-Typ {0} nicht unterstützt
Version_mismatch_The_context_has_version__loaded_and_the_new_content_being_loaded_is_version_=Versionsabweichung. Der Kontext hat die Version {0} geladen, und der neu geladene Inhalt ist die Version {1}.
Error_reading__from_package__=Fehler beim Lesen {0} aus dem Paket {1}#{2}: {3}
Error_parsing_=Fehler beim Parsen {0}:{1}
Unable_to_connect_to_terminology_server_Use_parameter_tx_na_tun_run_without_using_terminology_services_to_validate_LOINC_SNOMED_ICDX_etc_Error__=Keine Verbindung zum Terminologieserver möglich. Verwenden Sie den Parameter ''-tx n/a'' um ohne Verwendung von Terminologiediensten zu laufen welche LOINC, SNOMED, ICD-X usw. zu validieren. Fehler = {0}
Display_Name_for__should_be_one_of__instead_of_=Der Displayname für {0}#{1} sollte einer von ''{2}'' anstelle von ''{3}'' sein.
Unknown_Code__in_=Unbekannter Code {0} in {1}
Code_found_in_expansion_however_=Code in der Erweiterung gefunden, jedoch: {0}
None_of_the_provided_codes_are_in_the_value_set_=Keiner der bereitgestellten Codes ist im ValueSet {0}
Coding_has_no_system__cannot_validate=Kodierung hat kein System - kann nicht validiert werden
Unable_to_handle_system__concept_filter_with_op__=System {0} concept filter mit op = {1} nicht verarbeitbar
Unable_to_handle_system__filter_with_property__=System {0} Filter mit der Eigenschaft = {1} kann nicht verarbeitet werden.
Unable_to_resolve_system__value_set_has_include_with_no_system=System nicht auflösbar - ValueSet enthält Include ohne System
Unable_to_resolve_system__value_set_has_imports=System nicht auflösbar - ValueSet enthält Importe
Unable_to_resolve_system__value_set_expansion_has_multiple_systems=System nicht auflösbar - Extension des ValueSets enthält mehrere Systeme
Unable_to_resolve_system__value_set_has_no_includes_or_expansion=System nicht auflösbar - ValueSet enthält keine Includes oder Extensions
Unable_to_resolve_system__value_set_has_excludes=System nicht auflösbar - ValueSet enthält ausgeschlossen
Unable_to_resolve_system__no_value_set=System nicht auflösbar - kein ValueSet
This_base_property_must_be_an_Array_not_a_=Diese Basis Property muss ein Array sein, nicht ein {0}
This_property_must_be_an_Array_not_a_=Diese Eigenschaft muss ein Array sein, nicht ein {0}
documentmsg = (document)