Merge remote-tracking branch 'origin/master' into fixConverterEnums
This commit is contained in:
commit
e481ade2b3
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -4090,6 +4090,8 @@ public class VersionConvertor_40_50 {
|
|||
return MedicationRequest40_50.convertMedicationRequest((org.hl7.fhir.r4.model.MedicationRequest) src);
|
||||
if (src instanceof org.hl7.fhir.r4.model.MedicationStatement)
|
||||
return MedicationStatement40_50.convertMedicationStatement((org.hl7.fhir.r4.model.MedicationStatement) src);
|
||||
if (src instanceof org.hl7.fhir.r4.model.MedicinalProduct)
|
||||
return MedicinalProductDefinition40_50.convertMedicinalProduct((org.hl7.fhir.r4.model.MedicinalProduct) src);
|
||||
if (src instanceof org.hl7.fhir.r4.model.MessageDefinition)
|
||||
return MessageDefinition40_50.convertMessageDefinition((org.hl7.fhir.r4.model.MessageDefinition) src);
|
||||
if (src instanceof org.hl7.fhir.r4.model.MessageHeader)
|
||||
|
@ -4355,6 +4357,8 @@ public class VersionConvertor_40_50 {
|
|||
return MedicationRequest40_50.convertMedicationRequest((org.hl7.fhir.r5.model.MedicationRequest) src);
|
||||
if (src instanceof org.hl7.fhir.r5.model.MedicationUsage)
|
||||
return MedicationStatement40_50.convertMedicationStatement((org.hl7.fhir.r5.model.MedicationUsage) src);
|
||||
if (src instanceof org.hl7.fhir.r5.model.MedicinalProductDefinition)
|
||||
return MedicinalProductDefinition40_50.convertMedicinalProductDefinition((org.hl7.fhir.r5.model.MedicinalProductDefinition) src);
|
||||
if (src instanceof org.hl7.fhir.r5.model.MessageDefinition)
|
||||
return MessageDefinition40_50.convertMessageDefinition((org.hl7.fhir.r5.model.MessageDefinition) src);
|
||||
if (src instanceof org.hl7.fhir.r5.model.MessageHeader)
|
||||
|
|
|
@ -0,0 +1,360 @@
|
|||
package org.hl7.fhir.convertors.conv40_50;
|
||||
|
||||
/*-
|
||||
* #%L
|
||||
* org.hl7.fhir.convertors
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2019 Health Level 7
|
||||
* %%
|
||||
* 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.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* #L%
|
||||
*/
|
||||
import org.hl7.fhir.convertors.VersionConvertor_40_50;
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.r4.model.MarketingStatus;
|
||||
import org.hl7.fhir.r5.model.CodeableReference;
|
||||
|
||||
/*
|
||||
Copyright (c) 2011+, HL7, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of HL7 nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
|
||||
public class MedicinalProductDefinition40_50 extends VersionConvertor_40_50 {
|
||||
|
||||
public static org.hl7.fhir.r5.model.MedicinalProductDefinition convertMedicinalProduct(org.hl7.fhir.r4.model.MedicinalProduct src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition tgt = new org.hl7.fhir.r5.model.MedicinalProductDefinition();
|
||||
copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t));
|
||||
if (src.hasType())
|
||||
tgt.setType(convertCodeableConcept(src.getType()));
|
||||
if (src.hasDomain())
|
||||
tgt.setDomain(convertCoding(src.getDomain()));
|
||||
// version (new)
|
||||
// status (new)
|
||||
// description (new)
|
||||
if (src.hasCombinedPharmaceuticalDoseForm())
|
||||
tgt.setCombinedPharmaceuticalDoseForm(convertCodeableConcept(src.getCombinedPharmaceuticalDoseForm()));
|
||||
// indication (new)
|
||||
if (src.hasLegalStatusOfSupply())
|
||||
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
|
||||
if (src.hasAdditionalMonitoringIndicator())
|
||||
tgt.setAdditionalMonitoringIndicator(convertCodeableConcept(src.getAdditionalMonitoringIndicator()));
|
||||
for (org.hl7.fhir.r4.model.StringType t : src.getSpecialMeasures()) {
|
||||
// specialMeasures string -> CodeableConcept
|
||||
org.hl7.fhir.r5.model.CodeableConcept c = new org.hl7.fhir.r5.model.CodeableConcept();
|
||||
tgt.addSpecialMeasures(c);
|
||||
c.setTextElement(convertString(t));
|
||||
}
|
||||
if (src.hasPaediatricUseIndicator())
|
||||
tgt.setPaediatricUseIndicator(convertCodeableConcept(src.getPaediatricUseIndicator()));
|
||||
for (org.hl7.fhir.r4.model.CodeableConcept t : src.getProductClassification()) tgt.addProductClassification(convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r4.model.MarketingStatus t : src.getMarketingStatus()) tgt.addMarketingStatus(convertMarketingStatus(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPharmaceuticalProduct()) tgt.addPharmaceuticalProduct(convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getPackagedMedicinalProduct()) tgt.addPackagedMedicinalProduct(convertReference(t));
|
||||
// ingredient (new)
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getAttachedDocument()) tgt.addAttachedDocument(convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getMasterFile()) tgt.addMasterFile(convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getContact()) {
|
||||
// contact (Reference -> complex
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionContactComponent c = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionContactComponent();
|
||||
tgt.addContact(c);
|
||||
c.setContact(convertReference(t));
|
||||
}
|
||||
for (org.hl7.fhir.r4.model.Reference t : src.getClinicalTrial()) tgt.addClinicalTrial(convertReference(t));
|
||||
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent srcName : src.getName()) {
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameComponent tgtName = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameComponent();
|
||||
copyElement(srcName, tgtName);
|
||||
tgt.addName(tgtName);
|
||||
tgtName.setProductNameElement(convertString(srcName.getProductNameElement()));
|
||||
//type (new)
|
||||
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent srcPart : srcName.getNamePart()) {
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameNamePartComponent tgtPart = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameNamePartComponent();
|
||||
copyElement(srcPart, tgtPart);
|
||||
tgtName.addNamePart(tgtPart);
|
||||
tgtPart.setPartElement(convertString(srcPart.getPartElement()));
|
||||
tgtPart.setType(convertCoding(srcPart.getType()));
|
||||
}
|
||||
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent srcLang : srcName.getCountryLanguage()) {
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameCountryLanguageComponent tgtLang = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameCountryLanguageComponent();
|
||||
copyElement(srcLang, tgtLang);
|
||||
tgtName.addCountryLanguage(tgtLang);
|
||||
tgtLang.setCountry(convertCodeableConcept(srcLang.getCountry()));
|
||||
tgtLang.setLanguage(convertCodeableConcept(srcLang.getLanguage()));
|
||||
}
|
||||
}
|
||||
for (org.hl7.fhir.r4.model.Identifier t : src.getCrossReference()) {
|
||||
// cross-reference Identifier -> complex
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionCrossReferenceComponent c = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionCrossReferenceComponent();
|
||||
tgt.addCrossReference(c);
|
||||
c.setProduct(convertIdentifier(t));
|
||||
}
|
||||
for (org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent srcMBO : src.getManufacturingBusinessOperation()) {
|
||||
org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionManufacturingBusinessOperationComponent tgtMBO = new org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionManufacturingBusinessOperationComponent();
|
||||
copyElement(srcMBO, tgtMBO);
|
||||
tgt.addManufacturingBusinessOperation(tgtMBO);
|
||||
if (srcMBO.hasOperationType()) {
|
||||
tgtMBO.setType(convertCodeableConcept(srcMBO.getOperationType()));
|
||||
// operationType -> type[x]
|
||||
}
|
||||
if (srcMBO.hasAuthorisationReferenceNumber())
|
||||
throw new FHIRException("Converting MedicinalProduct.ManufacturingBusinessOperation.authorizationReferenceNumber is not supported");
|
||||
if (srcMBO.hasEffectiveDate()) {
|
||||
// effectiveDate - dateTime -> Period
|
||||
org.hl7.fhir.r5.model.Period p = new org.hl7.fhir.r5.model.Period();
|
||||
tgtMBO.setEffectiveDate(p);
|
||||
p.setStartElement(convertDateTime(srcMBO.getEffectiveDateElement()));
|
||||
p.setEndElement(convertDateTime(srcMBO.getEffectiveDateElement()));
|
||||
}
|
||||
if (srcMBO.hasConfidentialityIndicator())
|
||||
tgtMBO.setConfidentialityIndicator(convertCodeableConcept(srcMBO.getConfidentialityIndicator()));
|
||||
for (org.hl7.fhir.r4.model.Reference t : srcMBO.getManufacturer()) tgtMBO.addManufacturer(convertReference(t));
|
||||
if (srcMBO.hasRegulator())
|
||||
throw new FHIRException("Converting MedicinalProduct.ManufacturingBusinessOperation.regulator is not supported");
|
||||
// added authorization
|
||||
}
|
||||
if (src.hasSpecialDesignation())
|
||||
throw new FHIRException("Converting MedicinalProduct.specialDesignation is not supported");
|
||||
|
||||
return tgt;
|
||||
}
|
||||
// Todo convert references
|
||||
|
||||
public static org.hl7.fhir.r4.model.MedicinalProduct convertMedicinalProductDefinition(org.hl7.fhir.r5.model.MedicinalProductDefinition src) throws FHIRException {
|
||||
if (src == null)
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.MedicinalProduct tgt = new org.hl7.fhir.r4.model.MedicinalProduct();
|
||||
copyDomainResource(src, tgt);
|
||||
for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t));
|
||||
if (src.hasType())
|
||||
tgt.setType(convertCodeableConcept(src.getType()));
|
||||
if (src.hasDomain())
|
||||
tgt.setDomain(convertCoding(src.getDomain()));
|
||||
if (src.hasVersion())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.version is not supported");
|
||||
if (src.hasStatus())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.status is not supported");
|
||||
if (src.hasDescription())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.description is not supported");
|
||||
if (src.hasCombinedPharmaceuticalDoseForm())
|
||||
tgt.setCombinedPharmaceuticalDoseForm(convertCodeableConcept(src.getCombinedPharmaceuticalDoseForm()));
|
||||
if (src.hasIndication())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.indication is not supported");
|
||||
if (src.hasLegalStatusOfSupply())
|
||||
tgt.setLegalStatusOfSupply(convertCodeableConcept(src.getLegalStatusOfSupply()));
|
||||
if (src.hasAdditionalMonitoringIndicator())
|
||||
tgt.setAdditionalMonitoringIndicator(convertCodeableConcept(src.getAdditionalMonitoringIndicator()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getSpecialMeasures()) {
|
||||
// specialMeasures CodeableConcept -> string
|
||||
if (t.hasText()) {
|
||||
org.hl7.fhir.r4.model.StringType s = tgt.addSpecialMeasuresElement();
|
||||
copyElement(t.getTextElement(), s);
|
||||
s.setValue(t.getText());
|
||||
}
|
||||
checkBase(t, "MedicinalProductDefinition.specialMeasures");
|
||||
if (t.hasCoding())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.specialMeasures.coding is not supported");
|
||||
}
|
||||
if (src.hasPaediatricUseIndicator())
|
||||
tgt.setPaediatricUseIndicator(convertCodeableConcept(src.getPaediatricUseIndicator()));
|
||||
for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProductClassification()) tgt.addProductClassification(convertCodeableConcept(t));
|
||||
for (org.hl7.fhir.r5.model.MarketingStatus t : src.getMarketingStatus()) tgt.addMarketingStatus(convertMarketingStatus(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPharmaceuticalProduct()) tgt.addPharmaceuticalProduct(convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getPackagedMedicinalProduct()) tgt.addPackagedMedicinalProduct(convertReference(t));
|
||||
// ingredient (new)
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getAttachedDocument()) tgt.addAttachedDocument(convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getMasterFile()) tgt.addMasterFile(convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionContactComponent t : src.getContact()) {
|
||||
// contact complex -> reference
|
||||
if (t.hasContact()) {
|
||||
tgt.addContact(convertReference(t.getContact()));
|
||||
}
|
||||
checkBase(t, "MedicinalProductDefinition.contact");
|
||||
if (t.hasType())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.contact.type is not supported");
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.Reference t : src.getClinicalTrial()) tgt.addClinicalTrial(convertReference(t));
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameComponent srcName : src.getName()) {
|
||||
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent tgtName = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameComponent();
|
||||
copyElement(srcName, tgtName);
|
||||
tgt.addName(tgtName);
|
||||
tgtName.setProductNameElement(convertString(srcName.getProductNameElement()));
|
||||
//type (new)
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameNamePartComponent srcPart : srcName.getNamePart()) {
|
||||
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent tgtPart = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameNamePartComponent();
|
||||
copyElement(srcPart, tgtPart);
|
||||
tgtName.addNamePart(tgtPart);
|
||||
tgtPart.setPartElement(convertString(srcPart.getPartElement()));
|
||||
tgtPart.setType(convertCoding(srcPart.getType()));
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionNameCountryLanguageComponent srcLang : srcName.getCountryLanguage()) {
|
||||
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent tgtLang = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductNameCountryLanguageComponent();
|
||||
copyElement(srcLang, tgtLang);
|
||||
tgtName.addCountryLanguage(tgtLang);
|
||||
tgtLang.setCountry(convertCodeableConcept(srcLang.getCountry()));
|
||||
tgtLang.setLanguage(convertCodeableConcept(srcLang.getLanguage()));
|
||||
}
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionCrossReferenceComponent t : src.getCrossReference()) {
|
||||
// cross-reference complex -> Identifier
|
||||
if (t.hasProduct()) {
|
||||
if (t.getProduct() instanceof org.hl7.fhir.r5.model.Identifier)
|
||||
tgt.addCrossReference(convertIdentifier((org.hl7.fhir.r5.model.Identifier)t.getProduct()));
|
||||
else
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.crossReference.productReference is not supported");
|
||||
}
|
||||
checkBase(t, "MedicinalProductDefinition.crossReference");
|
||||
if (t.hasType())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.crossReference.type is not supported");
|
||||
}
|
||||
for (org.hl7.fhir.r5.model.MedicinalProductDefinition.MedicinalProductDefinitionManufacturingBusinessOperationComponent srcMBO : src.getManufacturingBusinessOperation()) {
|
||||
org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent tgtMBO = new org.hl7.fhir.r4.model.MedicinalProduct.MedicinalProductManufacturingBusinessOperationComponent();
|
||||
copyElement(srcMBO, tgtMBO);
|
||||
tgt.addManufacturingBusinessOperation(tgtMBO);
|
||||
if (srcMBO.hasType()) {
|
||||
// type[x] -> operationType
|
||||
if (srcMBO.getType() instanceof org.hl7.fhir.r5.model.CodeableConcept)
|
||||
tgtMBO.setOperationType(convertCodeableConcept((org.hl7.fhir.r5.model.CodeableConcept)srcMBO.getType()));
|
||||
else
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.manufacturingBusinessOperation.typeReference is not supported");
|
||||
}
|
||||
// added authorisationReferenceNumber
|
||||
if (srcMBO.hasEffectiveDate()) {
|
||||
// effectiveDate - Period -> dateTime
|
||||
org.hl7.fhir.r5.model.Period d = srcMBO.getEffectiveDate();
|
||||
checkBase(srcMBO, "MedicinalProductDefinition.manufacturingBusinessOperation.effectiveDate");
|
||||
if (d.hasStart() || d.hasEnd()) {
|
||||
if (d.hasStart() != d.hasEnd() || !d.getStart().equals(d.getEnd()))
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.manufacturingBusinessOperation.effectiveDate is not supported when start is not identical to end");
|
||||
else
|
||||
tgtMBO.setEffectiveDateElement(convertDateTime(d.getStartElement()));
|
||||
}
|
||||
}
|
||||
if (srcMBO.hasAuthorization())
|
||||
throw new FHIRException("Converting MedicinalProductDefinition.manufacturingBusinessOperation.authorization is not supported");
|
||||
if (srcMBO.hasConfidentialityIndicator())
|
||||
tgtMBO.setConfidentialityIndicator(convertCodeableConcept(srcMBO.getConfidentialityIndicator()));
|
||||
for (org.hl7.fhir.r5.model.Reference t : srcMBO.getManufacturer()) tgtMBO.addManufacturer(convertReference(t));
|
||||
// Added regulator
|
||||
// added authorization
|
||||
}
|
||||
// added specialDesignation
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public void checkBase(org.hl7.fhir.r5.model.Element e, String path) throws FHIRException {
|
||||
if (e.hasId())
|
||||
throw new FHIRException ("Converting " + path + ".id is not supported");
|
||||
if (e.hasExtension())
|
||||
throw new FHIRException ("Converting " + path + ".extension is not supported");
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes> convertMedicationStatementStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodesEnumFactory());
|
||||
VersionConvertor_40_50.copyElement(src, tgt);
|
||||
switch(src.getValue()) {
|
||||
case ACTIVE:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ACTIVE);
|
||||
break;
|
||||
case COMPLETED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.COMPLETED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ENTEREDINERROR);
|
||||
break;
|
||||
case INTENDED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.INTENDED);
|
||||
break;
|
||||
case STOPPED:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.STOPPED);
|
||||
break;
|
||||
case ONHOLD:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.ONHOLD);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.UNKNOWN);
|
||||
break;
|
||||
case NOTTAKEN:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NOTTAKEN);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
|
||||
static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus> convertMedicationStatementStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.MedicationUsage.MedicationUsageStatusCodes> src) throws FHIRException {
|
||||
if (src == null || src.isEmpty())
|
||||
return null;
|
||||
org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatusEnumFactory());
|
||||
VersionConvertor_40_50.copyElement(src, tgt);
|
||||
switch(src.getValue()) {
|
||||
case ACTIVE:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ACTIVE);
|
||||
break;
|
||||
case COMPLETED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.COMPLETED);
|
||||
break;
|
||||
case ENTEREDINERROR:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ENTEREDINERROR);
|
||||
break;
|
||||
case INTENDED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.INTENDED);
|
||||
break;
|
||||
case STOPPED:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.STOPPED);
|
||||
break;
|
||||
case ONHOLD:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.ONHOLD);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.UNKNOWN);
|
||||
break;
|
||||
case NOTTAKEN:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NOTTAKEN);
|
||||
break;
|
||||
default:
|
||||
tgt.setValue(org.hl7.fhir.r4.model.MedicationStatement.MedicationStatementStatus.NULL);
|
||||
break;
|
||||
}
|
||||
return tgt;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -326,6 +326,7 @@ public class StructureMapUtilities {
|
|||
lexer.token("map");
|
||||
StructureMap result = new StructureMap();
|
||||
result.setUrl(lexer.readConstant("url"));
|
||||
result.setId(tail(result.getUrl()));
|
||||
lexer.token("=");
|
||||
result.setName(lexer.readConstant("name"));
|
||||
lexer.skipComments();
|
||||
|
@ -344,10 +345,15 @@ public class StructureMapUtilities {
|
|||
parseGroup(result, lexer);
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void parseConceptMap(StructureMap result, FHIRLexer lexer) throws FHIRLexerException {
|
||||
private String tail(String url) {
|
||||
return url.substring(url.lastIndexOf("/")+1);
|
||||
}
|
||||
|
||||
private void parseConceptMap(StructureMap result, FHIRLexer lexer) throws FHIRLexerException {
|
||||
lexer.token("conceptmap");
|
||||
ConceptMap map = new ConceptMap();
|
||||
String id = lexer.readConstant("map id");
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -655,6 +655,7 @@ public class StructureMapUtilities {
|
|||
lexer.token("map");
|
||||
StructureMap result = new StructureMap();
|
||||
result.setUrl(lexer.readConstant("url"));
|
||||
result.setId(tail(result.getUrl()));
|
||||
lexer.token("=");
|
||||
result.setName(lexer.readConstant("name"));
|
||||
lexer.skipComments();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -45,17 +45,21 @@ import org.hl7.fhir.r4.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
|||
import org.hl7.fhir.r4.terminologies.ValueSetExpanderSimple;
|
||||
import org.hl7.fhir.r4.utils.ToolingExtensions;
|
||||
import org.hl7.fhir.utilities.OIDUtils;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.TranslationServices;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class BaseWorkerContext implements IWorkerContext {
|
||||
|
||||
|
@ -438,25 +442,25 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
// --- validate code -------------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display) {
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display) {
|
||||
Coding c = new Coding(system, code, display);
|
||||
return validateCode(options, c, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display, ValueSet vs) {
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ValueSet vs) {
|
||||
Coding c = new Coding(system, code, display);
|
||||
return validateCode(options, c, vs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String code, ValueSet vs) {
|
||||
public ValidationResult validateCode(ValidationOptions options, String code, ValueSet vs) {
|
||||
Coding c = new Coding(null, code, null);
|
||||
return doValidateCode(options, c, vs, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display, ConceptSetComponent vsi) {
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ConceptSetComponent vsi) {
|
||||
Coding c = new Coding(system, code, display);
|
||||
ValueSet vs = new ValueSet();
|
||||
vs.setUrl(Utilities.makeUuidUrn());
|
||||
|
@ -465,11 +469,11 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, Coding code, ValueSet vs) {
|
||||
public ValidationResult validateCode(ValidationOptions options, Coding code, ValueSet vs) {
|
||||
return doValidateCode(options, code, vs, false);
|
||||
}
|
||||
|
||||
public ValidationResult doValidateCode(TerminologyServiceOptions options, Coding code, ValueSet vs, boolean implySystem) {
|
||||
public ValidationResult doValidateCode(ValidationOptions options, Coding code, ValueSet vs, boolean implySystem) {
|
||||
CacheToken cacheToken = txCache != null ? txCache.generateValidationToken(options, code, vs) : null;
|
||||
ValidationResult res = null;
|
||||
if (txCache != null)
|
||||
|
@ -511,7 +515,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
return res;
|
||||
}
|
||||
|
||||
private void setTerminologyOptions(TerminologyServiceOptions options, Parameters pIn) {
|
||||
private void setTerminologyOptions(ValidationOptions options, Parameters pIn) {
|
||||
if (options != null) {
|
||||
if (!Utilities.noString(options.getLanguage()))
|
||||
pIn.addParameter("displayLanguage", options.getLanguage());
|
||||
|
@ -519,7 +523,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, CodeableConcept code, ValueSet vs) {
|
||||
public ValidationResult validateCode(ValidationOptions options, CodeableConcept code, ValueSet vs) {
|
||||
CacheToken cacheToken = txCache.generateValidationToken(options, code, vs);
|
||||
ValidationResult res = txCache.getValidation(cacheToken);
|
||||
if (res != null)
|
||||
|
|
|
@ -51,6 +51,7 @@ import org.hl7.fhir.r4.utils.IResourceValidator;
|
|||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.TranslationServices;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -376,7 +377,7 @@ public interface IWorkerContext {
|
|||
* @param display
|
||||
* @return
|
||||
*/
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display);
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display);
|
||||
|
||||
/**
|
||||
* Validation of a code - consult the terminology service
|
||||
|
@ -392,10 +393,10 @@ public interface IWorkerContext {
|
|||
* @param display
|
||||
* @return
|
||||
*/
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display, ValueSet vs);
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String code, ValueSet vs);
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, Coding code, ValueSet vs);
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, CodeableConcept code, ValueSet vs);
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ValueSet vs);
|
||||
public ValidationResult validateCode(ValidationOptions options, String code, ValueSet vs);
|
||||
public ValidationResult validateCode(ValidationOptions options, Coding code, ValueSet vs);
|
||||
public ValidationResult validateCode(ValidationOptions options, CodeableConcept code, ValueSet vs);
|
||||
|
||||
/**
|
||||
* Validation of a code - consult the terminology service
|
||||
|
@ -411,7 +412,7 @@ public interface IWorkerContext {
|
|||
* @param display
|
||||
* @return
|
||||
*/
|
||||
public ValidationResult validateCode(TerminologyServiceOptions options, String system, String code, String display, ConceptSetComponent vsi);
|
||||
public ValidationResult validateCode(ValidationOptions options, String system, String code, String display, ConceptSetComponent vsi);
|
||||
|
||||
/**
|
||||
* returns the recommended tla for the type
|
||||
|
|
|
@ -46,7 +46,6 @@ import org.hl7.fhir.r4.model.ValueSet.ValueSetExpansionContainsComponent;
|
|||
import org.hl7.fhir.r4.terminologies.ValueSetExpander.TerminologyServiceErrorClass;
|
||||
import org.hl7.fhir.r4.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
|
@ -55,6 +54,7 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonNull;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
||||
/**
|
||||
* This implements a two level cache.
|
||||
|
@ -112,7 +112,7 @@ public class TerminologyCache {
|
|||
load();
|
||||
}
|
||||
|
||||
public CacheToken generateValidationToken(TerminologyServiceOptions options, Coding code, ValueSet vs) {
|
||||
public CacheToken generateValidationToken(ValidationOptions options, Coding code, ValueSet vs) {
|
||||
CacheToken ct = new CacheToken();
|
||||
if (code.hasSystem())
|
||||
ct.name = getNameForSystem(code.getSystem());
|
||||
|
@ -130,7 +130,7 @@ public class TerminologyCache {
|
|||
return ct;
|
||||
}
|
||||
|
||||
public CacheToken generateValidationToken(TerminologyServiceOptions options, CodeableConcept code, ValueSet vs) {
|
||||
public CacheToken generateValidationToken(ValidationOptions options, CodeableConcept code, ValueSet vs) {
|
||||
CacheToken ct = new CacheToken();
|
||||
for (Coding c : code.getCoding()) {
|
||||
if (c.hasSystem())
|
||||
|
|
|
@ -30,8 +30,8 @@ import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionComponent;
|
|||
import org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent;
|
||||
import org.hl7.fhir.r4.model.ValueSet.*;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -43,9 +43,9 @@ public class ValueSetCheckerSimple implements ValueSetChecker {
|
|||
private ValueSet valueset;
|
||||
private IWorkerContext context;
|
||||
private Map<String, ValueSetCheckerSimple> inner = new HashMap<>();
|
||||
private TerminologyServiceOptions options;
|
||||
private ValidationOptions options;
|
||||
|
||||
public ValueSetCheckerSimple(TerminologyServiceOptions options, ValueSet source, IWorkerContext context) {
|
||||
public ValueSetCheckerSimple(ValidationOptions options, ValueSet source, IWorkerContext context) {
|
||||
this.valueset = source;
|
||||
this.context = context;
|
||||
this.options = options;
|
||||
|
|
|
@ -712,6 +712,7 @@ public class StructureMapUtilities {
|
|||
lexer.token("map");
|
||||
StructureMap result = new StructureMap();
|
||||
result.setUrl(lexer.readConstant("url"));
|
||||
result.setId(tail(result.getUrl()));
|
||||
lexer.token("=");
|
||||
result.setName(lexer.readConstant("name"));
|
||||
lexer.skipComments();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
|
||||
|
||||
public static List<ElementDefinition> getChildMap(StructureDefinition profile, ElementDefinition element) throws DefinitionException {
|
||||
public List<ElementDefinition> getChildMap(StructureDefinition profile, ElementDefinition element) throws DefinitionException {
|
||||
if (element.getContentReference()!=null) {
|
||||
for (ElementDefinition e : profile.getSnapshot().getElement()) {
|
||||
if (element.getContentReference().equals("#"+e.getId()))
|
||||
|
@ -341,7 +341,7 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
}
|
||||
|
||||
|
||||
public static List<ElementDefinition> getSliceList(StructureDefinition profile, ElementDefinition element) throws DefinitionException {
|
||||
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");
|
||||
|
||||
|
@ -368,11 +368,11 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
* @param path The path of the element within the structure to get the children for
|
||||
* @return A List containing the element children (all of them are Elements)
|
||||
*/
|
||||
public static List<ElementDefinition> getChildList(StructureDefinition profile, String path, String id) {
|
||||
public List<ElementDefinition> getChildList(StructureDefinition profile, String path, String id) {
|
||||
return getChildList(profile, path, id, false);
|
||||
}
|
||||
|
||||
public static List<ElementDefinition> getChildList(StructureDefinition profile, String path, String id, boolean diff) {
|
||||
public List<ElementDefinition> getChildList(StructureDefinition profile, String path, String id, boolean diff) {
|
||||
List<ElementDefinition> res = new ArrayList<ElementDefinition>();
|
||||
|
||||
boolean capturing = id==null;
|
||||
|
@ -415,11 +415,11 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
return res;
|
||||
}
|
||||
|
||||
public static List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element, boolean diff) {
|
||||
public List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element, boolean diff) {
|
||||
return getChildList(structure, element.getPath(), element.getId(), diff);
|
||||
}
|
||||
|
||||
public static List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element) {
|
||||
public List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element) {
|
||||
return getChildList(structure, element.getPath(), element.getId(), false);
|
||||
}
|
||||
|
||||
|
@ -585,6 +585,13 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
else
|
||||
messages.add(new ValidationMessage(Source.ProfileValidator, ValidationMessage.IssueType.VALUE, url, msg, ValidationMessage.IssueSeverity.ERROR));
|
||||
}
|
||||
// hack around a problem in R4 definitions (somewhere?)
|
||||
for (ElementDefinition ed : derived.getSnapshot().getElement()) {
|
||||
for (ElementDefinitionMappingComponent mm : ed.getMapping()) {
|
||||
mm.setMap(mm.getMap().trim());
|
||||
|
||||
}
|
||||
}
|
||||
if (derived.getDerivation() == TypeDerivationRule.SPECIALIZATION) {
|
||||
for (ElementDefinition ed : derived.getSnapshot().getElement()) {
|
||||
if (!ed.hasBase()) {
|
||||
|
@ -2490,15 +2497,18 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
for (ElementDefinitionMappingComponent d : base.getMapping()) {
|
||||
found = found || (d.getIdentity().equals(s.getIdentity()) && d.getMap().equals(s.getMap()));
|
||||
}
|
||||
if (!found)
|
||||
if (!found) {
|
||||
base.getMapping().add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (trimDifferential)
|
||||
else if (trimDifferential) {
|
||||
derived.getMapping().clear();
|
||||
else
|
||||
for (ElementDefinitionMappingComponent t : derived.getMapping())
|
||||
} else {
|
||||
for (ElementDefinitionMappingComponent t : derived.getMapping()) {
|
||||
t.setUserData(DERIVATION_EQUALS, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ElementDefinitionMappingComponent m : base.getMapping()) {
|
||||
if (m.hasMap()) {
|
||||
|
@ -2509,8 +2519,9 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
// todo: constraints are cumulative. there is no replacing
|
||||
for (ElementDefinitionConstraintComponent s : base.getConstraint()) {
|
||||
s.setUserData(IS_DERIVED, true);
|
||||
if (!s.hasSource())
|
||||
if (!s.hasSource()) {
|
||||
s.setSource(srcSD.getUrl());
|
||||
}
|
||||
}
|
||||
if (derived.hasConstraint()) {
|
||||
for (ElementDefinitionConstraintComponent s : derived.getConstraint()) {
|
||||
|
@ -2521,19 +2532,22 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
}
|
||||
}
|
||||
for (IdType id : derived.getCondition()) {
|
||||
if (!base.hasCondition(id))
|
||||
if (!base.hasCondition(id)) {
|
||||
base.getCondition().add(id);
|
||||
}
|
||||
}
|
||||
|
||||
// now, check that we still have a bindable type; if not, delete the binding - see task 8477
|
||||
if (dest.hasBinding() && !hasBindableType(dest))
|
||||
if (dest.hasBinding() && !hasBindableType(dest)) {
|
||||
dest.setBinding(null);
|
||||
}
|
||||
|
||||
// finally, we copy any extensions from source to dest
|
||||
for (Extension ex : derived.getExtension()) {
|
||||
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ex.getUrl());
|
||||
if (sd == null || sd.getSnapshot() == null || sd.getSnapshot().getElementFirstRep().getMax().equals("1"))
|
||||
if (sd == null || sd.getSnapshot() == null || sd.getSnapshot().getElementFirstRep().getMax().equals("1")) {
|
||||
ToolingExtensions.removeExtension(dest, ex.getUrl());
|
||||
}
|
||||
dest.addExtension(ex.copy());
|
||||
}
|
||||
}
|
||||
|
@ -2622,18 +2636,21 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
private boolean hasBindableType(ElementDefinition ed) {
|
||||
for (TypeRefComponent tr : ed.getType()) {
|
||||
if (Utilities.existsInList(tr.getWorkingCode(), "Coding", "CodeableConcept", "Quantity", "uri", "string", "code"))
|
||||
if (Utilities.existsInList(tr.getWorkingCode(), "Coding", "CodeableConcept", "Quantity", "uri", "string", "code")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean isLargerMax(String derived, String base) {
|
||||
if ("*".equals(base))
|
||||
if ("*".equals(base)) {
|
||||
return false;
|
||||
if ("*".equals(derived))
|
||||
}
|
||||
if ("*".equals(derived)) {
|
||||
return true;
|
||||
}
|
||||
return Integer.parseInt(derived) > Integer.parseInt(base);
|
||||
}
|
||||
|
||||
|
@ -2645,10 +2662,12 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
private boolean codesInExpansion(List<ValueSetExpansionContainsComponent> contains, ValueSetExpansionComponent expansion) {
|
||||
for (ValueSetExpansionContainsComponent cc : contains) {
|
||||
if (!inExpansion(cc, expansion.getContains()))
|
||||
if (!inExpansion(cc, expansion.getContains())) {
|
||||
return false;
|
||||
if (!codesInExpansion(cc.getContains(), expansion))
|
||||
}
|
||||
if (!codesInExpansion(cc.getContains(), expansion)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2656,10 +2675,12 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
private boolean inExpansion(ValueSetExpansionContainsComponent cc, List<ValueSetExpansionContainsComponent> contains) {
|
||||
for (ValueSetExpansionContainsComponent cc1 : contains) {
|
||||
if (cc.getSystem().equals(cc1.getSystem()) && cc.getCode().equals(cc1.getCode()))
|
||||
if (cc.getSystem().equals(cc1.getSystem()) && cc.getCode().equals(cc1.getCode())) {
|
||||
return true;
|
||||
if (inExpansion(cc, cc1.getContains()))
|
||||
}
|
||||
if (inExpansion(cc, cc1.getContains())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -2707,24 +2728,28 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
private int findEnd(List<ElementDefinition> list, ElementDefinition ed, int cursor) {
|
||||
String path = ed.getPath()+".";
|
||||
while (cursor < list.size() && list.get(cursor).getPath().startsWith(path))
|
||||
while (cursor < list.size() && list.get(cursor).getPath().startsWith(path)) {
|
||||
cursor++;
|
||||
}
|
||||
return cursor;
|
||||
}
|
||||
|
||||
|
||||
private ElementDefinition getMatchInDerived(ElementDefinition ed, List<ElementDefinition> list) {
|
||||
for (ElementDefinition t : list)
|
||||
if (t.getPath().equals(ed.getPath()))
|
||||
for (ElementDefinition t : list) {
|
||||
if (t.getPath().equals(ed.getPath())) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private ElementDefinition getMatchInDerived(ElementDefinition ed, List<ElementDefinition> list, int start, int end) {
|
||||
for (int i = start; i < end; i++) {
|
||||
ElementDefinition t = list.get(i);
|
||||
if (t.getPath().equals(ed.getPath()))
|
||||
if (t.getPath().equals(ed.getPath())) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -2732,8 +2757,9 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
|
||||
private boolean isImmediateChild(ElementDefinition ed) {
|
||||
String p = ed.getPath();
|
||||
if (!p.contains("."))
|
||||
if (!p.contains(".")) {
|
||||
return false;
|
||||
}
|
||||
p = p.substring(p.indexOf(".")+1);
|
||||
return !p.contains(".");
|
||||
}
|
||||
|
@ -3303,8 +3329,10 @@ public class ProfileUtilities extends TranslatingUtilities {
|
|||
s = "@"+s;
|
||||
String hint = "";
|
||||
hint = checkAdd(hint, (element.hasSliceName() ? translate("sd.table", "Slice")+" "+element.getSliceName() : ""));
|
||||
hint = checkAdd(hint, (hasDef && element.hasSliceName() ? ": " : ""));
|
||||
hint = checkAdd(hint, !hasDef ? null : gt(element.getDefinitionElement()));
|
||||
if (hasDef && element.hasDefinition()) {
|
||||
hint = checkAdd(hint, (hasDef && element.hasSliceName() ? ": " : ""));
|
||||
hint = checkAdd(hint, !hasDef ? null : gt(element.getDefinitionElement()));
|
||||
}
|
||||
Cell left = gen.new Cell(null, ref, s, hint, null);
|
||||
row.getCells().add(left);
|
||||
Cell gc = gen.new Cell();
|
||||
|
|
|
@ -188,6 +188,7 @@ public class ShExGenerator {
|
|||
* this makes internal metadata services available to the generator - retrieving structure definitions, and value set expansion etc
|
||||
*/
|
||||
private IWorkerContext context;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
/**
|
||||
* innerTypes -- inner complex types. Currently flattened in ShEx (doesn't have to be, btw)
|
||||
|
@ -208,6 +209,7 @@ public class ShExGenerator {
|
|||
public ShExGenerator(IWorkerContext context) {
|
||||
super();
|
||||
this.context = context;
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
innerTypes = new HashSet<Pair<StructureDefinition, ElementDefinition>>();
|
||||
emittedInnerTypes = new HashSet<Pair<StructureDefinition, ElementDefinition>>();
|
||||
datatypes = new HashSet<String>();
|
||||
|
@ -486,7 +488,7 @@ public class ShExGenerator {
|
|||
element_def.add("id", "fhir:" + (id.charAt(0) == id.toLowerCase().charAt(0)? shortId : id) + " ");
|
||||
}
|
||||
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildList(sd, ed);
|
||||
List<ElementDefinition> children = profileUtilities.getChildList(sd, ed);
|
||||
if (children.size() > 0) {
|
||||
innerTypes.add(new ImmutablePair<StructureDefinition, ElementDefinition>(sd, ed));
|
||||
defn = simpleElement(sd, ed, id);
|
||||
|
@ -571,7 +573,7 @@ public class ShExGenerator {
|
|||
if(typ.hasProfile()) {
|
||||
if(typ.getWorkingCode().equals("Reference"))
|
||||
return genReference("", typ);
|
||||
else if(ProfileUtilities.getChildList(sd, ed).size() > 0) {
|
||||
else if(profileUtilities.getChildList(sd, ed).size() > 0) {
|
||||
// inline anonymous type - give it a name and factor it out
|
||||
innerTypes.add(new ImmutablePair<StructureDefinition, ElementDefinition>(sd, ed));
|
||||
return simpleElement(sd, ed, id);
|
||||
|
@ -704,7 +706,7 @@ public class ShExGenerator {
|
|||
element_reference.add("comment", comment == null? " " : "# " + comment);
|
||||
|
||||
List<String> elements = new ArrayList<String>();
|
||||
for (ElementDefinition child: ProfileUtilities.getChildList(sd, path, null))
|
||||
for (ElementDefinition child: profileUtilities.getChildList(sd, path, null))
|
||||
elements.add(genElementDefinition(sd, child));
|
||||
|
||||
element_reference.add("elements", StringUtils.join(elements, "\n"));
|
||||
|
|
|
@ -107,10 +107,12 @@ public class XmlSchemaGenerator {
|
|||
private String genDate;
|
||||
private String license;
|
||||
private boolean annotations;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public XmlSchemaGenerator(String folder, IWorkerContext context) {
|
||||
this.folder = folder;
|
||||
this.context = context;
|
||||
this.profileUtilities = new ProfileUtilities(context, null, null);
|
||||
}
|
||||
|
||||
public boolean isSingle() {
|
||||
|
@ -325,12 +327,12 @@ public class XmlSchemaGenerator {
|
|||
ln(" <xs:sequence>");
|
||||
|
||||
// hack....
|
||||
for (ElementDefinition edc : ProfileUtilities.getChildList(sd, ed)) {
|
||||
for (ElementDefinition edc : profileUtilities.getChildList(sd, ed)) {
|
||||
if (!(edc.hasRepresentation(PropertyRepresentation.XMLATTR) || edc.hasRepresentation(PropertyRepresentation.XMLTEXT)) && !inheritedElement(edc))
|
||||
produceElement(sd, ed, edc, lang);
|
||||
}
|
||||
ln(" </xs:sequence>");
|
||||
for (ElementDefinition edc : ProfileUtilities.getChildList(sd, ed)) {
|
||||
for (ElementDefinition edc : profileUtilities.getChildList(sd, ed)) {
|
||||
if ((edc.hasRepresentation(PropertyRepresentation.XMLATTR) || edc.hasRepresentation(PropertyRepresentation.XMLTEXT)) && !inheritedElement(edc))
|
||||
produceAttribute(sd, ed, edc, lang);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@ 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.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
@ -81,7 +83,6 @@ 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.OIDUtils;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.TranslationServices;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
|
@ -94,6 +95,8 @@ import com.google.gson.JsonObject;
|
|||
|
||||
public abstract class BaseWorkerContext implements IWorkerContext {
|
||||
|
||||
private Locale locale;
|
||||
|
||||
public class MetadataResourceVersionComparator<T extends CanonicalResource> implements Comparator<T> {
|
||||
|
||||
private List<T> list;
|
||||
|
@ -417,6 +420,19 @@ 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;
|
||||
|
@ -652,7 +668,12 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
if (expParameters == null)
|
||||
throw new Error("No ExpansionProfile provided");
|
||||
pin.addParameter().setName("profile").setResource(expParameters);
|
||||
txLog.clearLastId();
|
||||
if (txLog != null) {
|
||||
txLog.clearLastId();
|
||||
}
|
||||
if (txClient == null) {
|
||||
throw new FHIRException("Attempt to use Terminology server when no Terminology server is available");
|
||||
}
|
||||
Parameters pOut;
|
||||
if (vs == null)
|
||||
pOut = txClient.validateCS(pin);
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.EnumSet;
|
|||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -50,7 +51,6 @@ import org.hl7.fhir.r5.terminologies.ValueSetExpander.TerminologyServiceErrorCla
|
|||
import org.hl7.fhir.r5.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.r5.utils.INarrativeGenerator;
|
||||
import org.hl7.fhir.r5.utils.IResourceValidator;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.TranslationServices;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
|
@ -327,7 +327,11 @@ public interface IWorkerContext {
|
|||
* @throws FHIRException
|
||||
*/
|
||||
public ValueSetExpansionOutcome expandVS(ConceptSetComponent inc, boolean hierarchical) throws TerminologyServiceException;
|
||||
|
||||
|
||||
Locale getLocale();
|
||||
|
||||
void setLocale(Locale locale);
|
||||
|
||||
public class ValidationResult {
|
||||
private ConceptDefinitionComponent definition;
|
||||
private IssueSeverity severity;
|
||||
|
|
|
@ -46,9 +46,11 @@ import org.hl7.fhir.r5.model.DataType;
|
|||
public class ObjectConverter {
|
||||
|
||||
private IWorkerContext context;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public ObjectConverter(IWorkerContext context) {
|
||||
this.context = context;
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
}
|
||||
|
||||
public Element convert(Resource ig) throws IOException, FHIRException {
|
||||
|
@ -76,7 +78,7 @@ public class ObjectConverter {
|
|||
if (sd.getKind() == StructureDefinitionKind.PRIMITIVETYPE)
|
||||
res.setValue(((PrimitiveType) base).asStringValue());
|
||||
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());
|
||||
List<ElementDefinition> children = profileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());
|
||||
for (ElementDefinition child : children) {
|
||||
String n = tail(child.getPath());
|
||||
if (sd.getKind() != StructureDefinitionKind.PRIMITIVETYPE || !"value".equals(n)) {
|
||||
|
|
|
@ -44,12 +44,14 @@ public class Property {
|
|||
private IWorkerContext context;
|
||||
private ElementDefinition definition;
|
||||
private StructureDefinition structure;
|
||||
private Boolean canBePrimitive;
|
||||
private Boolean canBePrimitive;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure) {
|
||||
this.context = context;
|
||||
this.definition = definition;
|
||||
this.structure = structure;
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
@ -248,7 +250,7 @@ public class Property {
|
|||
protected List<Property> getChildProperties(String elementName, String statedType) throws FHIRException {
|
||||
ElementDefinition ed = definition;
|
||||
StructureDefinition sd = structure;
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildMap(sd, ed);
|
||||
List<ElementDefinition> children = profileUtilities.getChildMap(sd, ed);
|
||||
String url = null;
|
||||
if (children.isEmpty() || isElementWithOnlyExtension(ed, children)) {
|
||||
// ok, find the right definitions
|
||||
|
@ -313,7 +315,7 @@ public class Property {
|
|||
sd = context.fetchResource(StructureDefinition.class, url);
|
||||
if (sd == null)
|
||||
throw new DefinitionException("Unable to find type '"+t+"' for name '"+elementName+"' on property "+definition.getPath());
|
||||
children = ProfileUtilities.getChildMap(sd, sd.getSnapshot().getElement().get(0));
|
||||
children = profileUtilities.getChildMap(sd, sd.getSnapshot().getElement().get(0));
|
||||
}
|
||||
}
|
||||
List<Property> properties = new ArrayList<Property>();
|
||||
|
@ -326,7 +328,7 @@ public class Property {
|
|||
protected List<Property> getChildProperties(TypeDetails type) throws DefinitionException {
|
||||
ElementDefinition ed = definition;
|
||||
StructureDefinition sd = structure;
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildMap(sd, ed);
|
||||
List<ElementDefinition> children = profileUtilities.getChildMap(sd, ed);
|
||||
if (children.isEmpty()) {
|
||||
// ok, find the right definitions
|
||||
String t = null;
|
||||
|
@ -352,7 +354,7 @@ public class Property {
|
|||
sd = context.fetchResource(StructureDefinition.class, t);
|
||||
if (sd == null)
|
||||
throw new DefinitionException("Unable to find class '"+t+"' for name '"+ed.getPath()+"' on property "+definition.getPath());
|
||||
children = ProfileUtilities.getChildMap(sd, sd.getSnapshot().getElement().get(0));
|
||||
children = profileUtilities.getChildMap(sd, sd.getSnapshot().getElement().get(0));
|
||||
}
|
||||
}
|
||||
List<Property> properties = new ArrayList<Property>();
|
||||
|
|
|
@ -372,4 +372,48 @@ public class CodeSystemUtilities {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasCode(CodeSystem cs, String code) {
|
||||
for (ConceptDefinitionComponent cc : cs.getConcept()) {
|
||||
if (hasCode(cc, code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean hasCode(ConceptDefinitionComponent cc, String code) {
|
||||
if (code.equals(cc.getCode())) {
|
||||
return true;
|
||||
}
|
||||
for (ConceptDefinitionComponent c : cc.getConcept()) {
|
||||
if (hasCode(c, code)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ConceptDefinitionComponent getCode(CodeSystem cs, String code) {
|
||||
for (ConceptDefinitionComponent cc : cs.getConcept()) {
|
||||
ConceptDefinitionComponent cd = getCode(cc, code);
|
||||
if (cd != null) {
|
||||
return cd;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ConceptDefinitionComponent getCode(ConceptDefinitionComponent cc, String code) {
|
||||
if (code.equals(cc.getCode())) {
|
||||
return cc;
|
||||
}
|
||||
for (ConceptDefinitionComponent c : cc.getConcept()) {
|
||||
ConceptDefinitionComponent cd = getCode(c, code);
|
||||
if (cd != null) {
|
||||
return cd;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ 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.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions.ValueSetMode;
|
||||
|
|
|
@ -152,6 +152,7 @@ public class FHIRPathEngine {
|
|||
private Map<String, StructureDefinition> allTypes = new HashMap<String, StructureDefinition>();
|
||||
private boolean legacyMode; // some R2 and R3 constraints assume that != is valid for emptty sets, so when running for R2/R3, this is set ot true
|
||||
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
// if the fhir path expressions are allowed to use constants beyond those defined in the specification
|
||||
// the application can implement them by providing a constant resolver
|
||||
|
@ -249,6 +250,7 @@ public class FHIRPathEngine {
|
|||
public FHIRPathEngine(IWorkerContext worker) {
|
||||
super();
|
||||
this.worker = worker;
|
||||
profileUtilities = new ProfileUtilities(worker, null, null);
|
||||
for (StructureDefinition sd : worker.getStructures()) {
|
||||
if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && sd.getKind() != StructureDefinitionKind.LOGICAL)
|
||||
allTypes.put(sd.getName(), sd);
|
||||
|
@ -1049,7 +1051,7 @@ public class FHIRPathEngine {
|
|||
switch (exp.getFunction()) {
|
||||
case Empty: return checkParamCount(lexer, location, exp, 0);
|
||||
case Not: return checkParamCount(lexer, location, exp, 0);
|
||||
case Exists: return checkParamCount(lexer, location, exp, 0);
|
||||
case Exists: return checkParamCount(lexer, location, exp, 0, 1);
|
||||
case SubsetOf: return checkParamCount(lexer, location, exp, 1);
|
||||
case SupersetOf: return checkParamCount(lexer, location, exp, 1);
|
||||
case IsDistinct: return checkParamCount(lexer, location, exp, 0);
|
||||
|
@ -2379,8 +2381,10 @@ public class FHIRPathEngine {
|
|||
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean);
|
||||
case Not :
|
||||
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean);
|
||||
case Exists :
|
||||
case Exists : {
|
||||
checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean));
|
||||
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean);
|
||||
}
|
||||
case SubsetOf : {
|
||||
checkParamTypes(exp.getFunction().toCode(), paramTypes, focus);
|
||||
return new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Boolean);
|
||||
|
@ -3305,9 +3309,19 @@ public class FHIRPathEngine {
|
|||
private List<Base> funcExists(ExecutionContext context, List<Base> focus, ExpressionNode exp) {
|
||||
List<Base> result = new ArrayList<Base>();
|
||||
boolean empty = true;
|
||||
for (Base f : focus)
|
||||
if (!f.isEmpty())
|
||||
List<Base> pc = new ArrayList<Base>();
|
||||
for (Base f : focus) {
|
||||
if (exp.getParameters().size() == 1) {
|
||||
pc.clear();
|
||||
pc.add(f);
|
||||
Equality v = asBool(execute(changeThis(context, f), pc, exp.getParameters().get(0), true));
|
||||
if (v == Equality.True) {
|
||||
empty = false;
|
||||
}
|
||||
} else if (!f.isEmpty()) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
result.add(new BooleanType(!empty).noExtensions());
|
||||
return result;
|
||||
}
|
||||
|
@ -4204,14 +4218,14 @@ public class FHIRPathEngine {
|
|||
focus = element;
|
||||
} else {
|
||||
List<ElementDefinition> childDefinitions;
|
||||
childDefinitions = ProfileUtilities.getChildMap(sd, element);
|
||||
childDefinitions = profileUtilities.getChildMap(sd, element);
|
||||
// if that's empty, get the children of the type
|
||||
if (childDefinitions.isEmpty()) {
|
||||
|
||||
sd = fetchStructureByType(element);
|
||||
if (sd == null)
|
||||
throw new DefinitionException("Problem with use of resolve() - profile '"+element.getType().get(0).getProfile()+"' on "+element.getId()+" could not be resolved");
|
||||
childDefinitions = ProfileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());
|
||||
childDefinitions = profileUtilities.getChildMap(sd, sd.getSnapshot().getElementFirstRep());
|
||||
}
|
||||
for (ElementDefinition t : childDefinitions) {
|
||||
if (tailMatches(t, expr.getName())) {
|
||||
|
@ -4237,14 +4251,14 @@ public class FHIRPathEngine {
|
|||
} else if ("extension".equals(expr.getName())) {
|
||||
String targetUrl = expr.getParameters().get(0).getConstant().primitiveValue();
|
||||
// targetUrl = targetUrl.substring(1,targetUrl.length()-1);
|
||||
List<ElementDefinition> childDefinitions = ProfileUtilities.getChildMap(sd, element);
|
||||
List<ElementDefinition> childDefinitions = profileUtilities.getChildMap(sd, element);
|
||||
for (ElementDefinition t : childDefinitions) {
|
||||
if (t.getPath().endsWith(".extension") && t.hasSliceName()) {
|
||||
StructureDefinition exsd = worker.fetchResource(StructureDefinition.class, t.getType().get(0).getProfile().get(0).getValue());
|
||||
while (exsd!=null && !exsd.getBaseDefinition().equals("http://hl7.org/fhir/StructureDefinition/Extension"))
|
||||
exsd = worker.fetchResource(StructureDefinition.class, exsd.getBaseDefinition());
|
||||
if (exsd.getUrl().equals(targetUrl)) {
|
||||
if (ProfileUtilities.getChildMap(sd, t).isEmpty())
|
||||
if (profileUtilities.getChildMap(sd, t).isEmpty())
|
||||
sd = exsd;
|
||||
focus = t;
|
||||
break;
|
||||
|
@ -4269,7 +4283,7 @@ public class FHIRPathEngine {
|
|||
}
|
||||
|
||||
private ElementDefinition pickMandatorySlice(StructureDefinition sd, ElementDefinition element) throws DefinitionException {
|
||||
List<ElementDefinition> list = ProfileUtilities.getSliceList(sd, element);
|
||||
List<ElementDefinition> list = profileUtilities.getSliceList(sd, element);
|
||||
for (ElementDefinition ed : list) {
|
||||
if (ed.getMin() > 0)
|
||||
return ed;
|
||||
|
|
|
@ -56,10 +56,12 @@ public class GraphQLSchemaGenerator {
|
|||
|
||||
private static final String INNER_TYPE_NAME = "gql.type.name";
|
||||
IWorkerContext context;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public GraphQLSchemaGenerator(IWorkerContext context) {
|
||||
super();
|
||||
this.context = context;
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
}
|
||||
|
||||
public void generateTypes(OutputStream stream) throws IOException, FHIRException {
|
||||
|
@ -265,7 +267,7 @@ public class GraphQLSchemaGenerator {
|
|||
}
|
||||
|
||||
private void generateProperties(List<StringBuilder> list, StringBuilder b, String typeName, StructureDefinition sd, ElementDefinition ed, String mode, String suffix) throws IOException {
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildList(sd, ed);
|
||||
List<ElementDefinition> children = profileUtilities.getChildList(sd, ed);
|
||||
for (ElementDefinition child : children) {
|
||||
if (child.hasContentReference()) {
|
||||
ElementDefinition ref = resolveContentReference(sd, child.getContentReference());
|
||||
|
|
|
@ -56,7 +56,6 @@ Copyright (c) 2011+, HL7, Inc
|
|||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
|
@ -91,6 +90,7 @@ import org.hl7.fhir.r5.model.Bundle.BundleEntryRequestComponent;
|
|||
import org.hl7.fhir.r5.model.Bundle.BundleEntryResponseComponent;
|
||||
import org.hl7.fhir.r5.model.Bundle.BundleEntrySearchComponent;
|
||||
import org.hl7.fhir.r5.model.Bundle.BundleType;
|
||||
import org.hl7.fhir.r5.model.CanonicalResource;
|
||||
import org.hl7.fhir.r5.model.CapabilityStatement;
|
||||
import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestComponent;
|
||||
import org.hl7.fhir.r5.model.CapabilityStatement.CapabilityStatementRestResourceComponent;
|
||||
|
@ -120,6 +120,7 @@ import org.hl7.fhir.r5.model.ConceptMap.TargetElementComponent;
|
|||
import org.hl7.fhir.r5.model.ContactDetail;
|
||||
import org.hl7.fhir.r5.model.ContactPoint;
|
||||
import org.hl7.fhir.r5.model.ContactPoint.ContactPointSystem;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
import org.hl7.fhir.r5.model.DateTimeType;
|
||||
import org.hl7.fhir.r5.model.DiagnosticReport;
|
||||
import org.hl7.fhir.r5.model.DomainResource;
|
||||
|
@ -127,6 +128,7 @@ import org.hl7.fhir.r5.model.Dosage;
|
|||
import org.hl7.fhir.r5.model.ElementDefinition;
|
||||
import org.hl7.fhir.r5.model.Enumeration;
|
||||
import org.hl7.fhir.r5.model.Enumerations.ConceptMapRelationship;
|
||||
import org.hl7.fhir.r5.model.Enumerations.FilterOperator;
|
||||
import org.hl7.fhir.r5.model.Extension;
|
||||
import org.hl7.fhir.r5.model.ExtensionHelper;
|
||||
import org.hl7.fhir.r5.model.HumanName;
|
||||
|
@ -136,7 +138,6 @@ import org.hl7.fhir.r5.model.Identifier;
|
|||
import org.hl7.fhir.r5.model.ImplementationGuide;
|
||||
import org.hl7.fhir.r5.model.InstantType;
|
||||
import org.hl7.fhir.r5.model.Meta;
|
||||
import org.hl7.fhir.r5.model.CanonicalResource;
|
||||
import org.hl7.fhir.r5.model.Narrative;
|
||||
import org.hl7.fhir.r5.model.Narrative.NarrativeStatus;
|
||||
import org.hl7.fhir.r5.model.OperationDefinition;
|
||||
|
@ -163,7 +164,6 @@ import org.hl7.fhir.r5.model.Timing;
|
|||
import org.hl7.fhir.r5.model.Timing.EventTiming;
|
||||
import org.hl7.fhir.r5.model.Timing.TimingRepeatComponent;
|
||||
import org.hl7.fhir.r5.model.Timing.UnitsOfTime;
|
||||
import org.hl7.fhir.r5.model.DataType;
|
||||
import org.hl7.fhir.r5.model.UriType;
|
||||
import org.hl7.fhir.r5.model.UsageContext;
|
||||
import org.hl7.fhir.r5.model.ValueSet;
|
||||
|
@ -171,8 +171,6 @@ import org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent;
|
|||
import org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptSetComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ConceptSetFilterComponent;
|
||||
import org.hl7.fhir.r5.model.Enumerations.FilterOperator;
|
||||
import org.hl7.fhir.r5.model.Enumerations.ResourceTypeEnum;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent;
|
||||
import org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent;
|
||||
|
@ -181,10 +179,8 @@ import org.hl7.fhir.r5.terminologies.CodeSystemUtilities.CodeSystemNavigator;
|
|||
import org.hl7.fhir.r5.terminologies.ValueSetExpander.ValueSetExpansionOutcome;
|
||||
import org.hl7.fhir.r5.utils.FHIRPathEngine.IEvaluationContext;
|
||||
import org.hl7.fhir.r5.utils.LiquidEngine.LiquidDocument;
|
||||
import org.hl7.fhir.r5.utils.NarrativeGenerator.ILiquidTemplateProvider;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.MarkDownProcessor;
|
||||
import org.hl7.fhir.utilities.TerminologyServiceOptions;
|
||||
import org.hl7.fhir.utilities.MarkDownProcessor.Dialect;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.validation.ValidationOptions;
|
||||
|
@ -482,7 +478,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
@Override
|
||||
public List<PropertyWrapper> children() {
|
||||
if (list == null) {
|
||||
children = ProfileUtilities.getChildList(structure, definition);
|
||||
children = profileUtilities.getChildList(structure, definition);
|
||||
list = new ArrayList<NarrativeGenerator.PropertyWrapper>();
|
||||
for (ElementDefinition child : children) {
|
||||
List<Element> elements = new ArrayList<Element>();
|
||||
|
@ -632,7 +628,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
@Override
|
||||
public List<PropertyWrapper> children() {
|
||||
if (list == null) {
|
||||
children = ProfileUtilities.getChildList(structure, definition);
|
||||
children = profileUtilities.getChildList(structure, definition);
|
||||
list = new ArrayList<NarrativeGenerator.PropertyWrapper>();
|
||||
for (ElementDefinition child : children) {
|
||||
List<org.hl7.fhir.r5.elementmodel.Element> elements = new ArrayList<org.hl7.fhir.r5.elementmodel.Element>();
|
||||
|
@ -703,7 +699,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
@Override
|
||||
public List<PropertyWrapper> children() {
|
||||
if (list2 == null) {
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildList(definition, definition.getSnapshot().getElement().get(0));
|
||||
List<ElementDefinition> children = profileUtilities.getChildList(definition, definition.getSnapshot().getElement().get(0));
|
||||
list2 = new ArrayList<NarrativeGenerator.PropertyWrapper>();
|
||||
for (ElementDefinition child : children) {
|
||||
List<org.hl7.fhir.r5.elementmodel.Element> elements = new ArrayList<org.hl7.fhir.r5.elementmodel.Element>();
|
||||
|
@ -841,7 +837,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
@Override
|
||||
public List<PropertyWrapper> children() {
|
||||
if (list2 == null) {
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildList(definition, definition.getSnapshot().getElement().get(0));
|
||||
List<ElementDefinition> children = profileUtilities.getChildList(definition, definition.getSnapshot().getElement().get(0));
|
||||
list2 = new ArrayList<NarrativeGenerator.PropertyWrapper>();
|
||||
for (ElementDefinition child : children) {
|
||||
List<Element> elements = new ArrayList<Element>();
|
||||
|
@ -1044,6 +1040,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
|
||||
private boolean noSlowLookup;
|
||||
private List<String> codeSystemPropList = new ArrayList<>();
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public NarrativeGenerator(String prefix, String basePath, IWorkerContext context) {
|
||||
super();
|
||||
|
@ -1077,6 +1074,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
|
||||
|
||||
private void init() {
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
renderingMaps.add(new ConceptMapRenderInstructions("Canonical Status", "http://hl7.org/fhir/ValueSet/resource-status", false));
|
||||
}
|
||||
|
||||
|
@ -2932,20 +2930,48 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (cp.hasExtension(ToolingExtensions.EXT_RENDERED_VALUE)) {
|
||||
return true;
|
||||
}
|
||||
if (cp.getCodeElement().hasExtension(ToolingExtensions.EXT_RENDERED_VALUE)) {
|
||||
return true;
|
||||
}
|
||||
String uri = cp.getUri();
|
||||
String code = null;
|
||||
if (Utilities.noString(uri)){
|
||||
return false;
|
||||
}
|
||||
if (uri.contains("#")) {
|
||||
code = uri.substring(uri.indexOf("#")+1);
|
||||
uri = uri.substring(0, uri.indexOf("#"));
|
||||
}
|
||||
return
|
||||
Utilities.existsInList(uri, "http://hl7.org/fhir/concept-properties") ||
|
||||
codeSystemPropList.contains(uri);
|
||||
if (Utilities.existsInList(uri, "http://hl7.org/fhir/concept-properties") || codeSystemPropList.contains(uri)) {
|
||||
return true;
|
||||
};
|
||||
CodeSystem cs = context.fetchCodeSystem(uri);
|
||||
if (cs == null) {
|
||||
return false;
|
||||
}
|
||||
return CodeSystemUtilities.hasCode(cs, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getDisplayForProperty(String uri) {
|
||||
if (Utilities.noString(uri)){
|
||||
return null;
|
||||
}
|
||||
String code = null;
|
||||
if (uri.contains("#")) {
|
||||
code = uri.substring(uri.indexOf("#")+1);
|
||||
uri = uri.substring(0, uri.indexOf("#"));
|
||||
}
|
||||
CodeSystem cs = context.fetchCodeSystem(uri);
|
||||
if (cs == null) {
|
||||
return null;
|
||||
}
|
||||
ConceptDefinitionComponent cc = CodeSystemUtilities.getCode(cs, code);
|
||||
return cc == null ? null : cc.getDisplay();
|
||||
}
|
||||
|
||||
|
||||
private int countConcepts(List<ConceptDefinitionComponent> list) {
|
||||
int count = list.size();
|
||||
for (ConceptDefinitionComponent c : list)
|
||||
|
@ -3450,10 +3476,10 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void generateCopyright(XhtmlNode x, ValueSet vs) {
|
||||
private void generateCopyright(XhtmlNode x, ValueSet vs) throws FHIRFormatError, DefinitionException, IOException {
|
||||
XhtmlNode p = x.para();
|
||||
p.b().tx("Copyright Statement:");
|
||||
smartAddText(p, " " + vs.getCopyright());
|
||||
addMarkdown(x, vs.getCopyright());
|
||||
}
|
||||
|
||||
private XhtmlNode addTableHeaderRowStandard(XhtmlNode t, boolean hasHierarchy, boolean hasDisplay, boolean definitions, boolean comments, boolean version, boolean deprecated, String lang, List<PropertyComponent> properties) {
|
||||
|
@ -3473,7 +3499,14 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
tr.td().b().tx(context.translator().translate("xhtml-gen-cs", "Version", lang));
|
||||
if (properties != null) {
|
||||
for (PropertyComponent pc : properties) {
|
||||
tr.td().b().tx(context.translator().translate("xhtml-gen-cs", ToolingExtensions.getPresentation(pc, pc.getCodeElement()), lang));
|
||||
String display = ToolingExtensions.getPresentation(pc, pc.getCodeElement());
|
||||
if (display == null || display.equals(pc.getCode()) && pc.hasUri()) {
|
||||
display = getDisplayForProperty(pc.getUri());
|
||||
if (display == null) {
|
||||
display = pc.getCode();
|
||||
}
|
||||
}
|
||||
tr.td().b().tx(context.translator().translate("xhtml-gen-cs", display, lang));
|
||||
}
|
||||
}
|
||||
return tr;
|
||||
|
@ -3854,18 +3887,22 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (vs.hasCopyrightElement())
|
||||
generateCopyright(x, vs);
|
||||
}
|
||||
XhtmlNode p = x.para();
|
||||
p.tx("This value set includes codes from the following code systems:");
|
||||
|
||||
XhtmlNode ul = x.ul();
|
||||
XhtmlNode li;
|
||||
for (ConceptSetComponent inc : vs.getCompose().getInclude()) {
|
||||
hasExtensions = genInclude(rcontext, ul, inc, "Include", langs, maps) || hasExtensions;
|
||||
}
|
||||
for (ConceptSetComponent exc : vs.getCompose().getExclude()) {
|
||||
hasExtensions = genInclude(rcontext, ul, exc, "Exclude", langs, maps) || hasExtensions;
|
||||
}
|
||||
if (vs.getCompose().getInclude().size() == 1 && vs.getCompose().getExclude().size() == 0) {
|
||||
hasExtensions = genInclude(rcontext, ul, vs.getCompose().getInclude().get(0), "Include", langs, maps) || hasExtensions;
|
||||
} else {
|
||||
XhtmlNode p = x.para();
|
||||
p.tx("This value set includes codes based on the following rules:");
|
||||
|
||||
XhtmlNode li;
|
||||
for (ConceptSetComponent inc : vs.getCompose().getInclude()) {
|
||||
hasExtensions = genInclude(rcontext, ul, inc, "Include", langs, maps) || hasExtensions;
|
||||
}
|
||||
for (ConceptSetComponent exc : vs.getCompose().getExclude()) {
|
||||
hasExtensions = genInclude(rcontext, ul, exc, "Exclude", langs, maps) || hasExtensions;
|
||||
}
|
||||
}
|
||||
|
||||
// now, build observed languages
|
||||
|
||||
if (langs.size() > 0) {
|
||||
|
@ -3967,6 +4004,10 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (inc.getConcept().size() > 0) {
|
||||
li.addText(type+" these codes as defined in ");
|
||||
addCsRef(inc, li, e);
|
||||
if (inc.hasVersion()) {
|
||||
li.addText(" version ");
|
||||
li.code(inc.getVersion());
|
||||
}
|
||||
|
||||
XhtmlNode t = li.table("none");
|
||||
boolean hasComments = false;
|
||||
|
@ -4093,6 +4134,9 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
}
|
||||
|
||||
private ConceptDefinitionComponent getConceptForCode(CodeSystem e, String code, ConceptSetComponent inc) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
// first, look in the code systems
|
||||
if (e == null)
|
||||
e = context.fetchCodeSystem(inc.getSystem());
|
||||
|
|
|
@ -136,10 +136,12 @@ public class QuestionnaireBuilder {
|
|||
// processing the response. for technical reasons, we still go through the process, but
|
||||
// we don't do the intensive parts of the work (save time)
|
||||
private Questionnaire prebuiltQuestionnaire;
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public QuestionnaireBuilder(IWorkerContext context) {
|
||||
super();
|
||||
this.context = context;
|
||||
profileUtilities = new ProfileUtilities(context, null, null);
|
||||
}
|
||||
|
||||
public Resource getReference() {
|
||||
|
@ -291,7 +293,7 @@ public class QuestionnaireBuilder {
|
|||
}
|
||||
|
||||
// now, we iterate the children
|
||||
List<ElementDefinition> list = ProfileUtilities.getChildList(profile, element);
|
||||
List<ElementDefinition> list = profileUtilities.getChildList(profile, element);
|
||||
for (ElementDefinition child : list) {
|
||||
|
||||
if (!isExempt(element, child) && !parents.contains(child)) {
|
||||
|
|
|
@ -229,7 +229,8 @@ public class StructureMapUtilities {
|
|||
private ITransformerServices services;
|
||||
private ProfileKnowledgeProvider pkp;
|
||||
private Map<String, Integer> ids = new HashMap<String, Integer>();
|
||||
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
|
||||
private ValidationOptions terminologyServiceOptions = new ValidationOptions();
|
||||
private ProfileUtilities profileUtilities;
|
||||
|
||||
public StructureMapUtilities(IWorkerContext worker, ITransformerServices services, ProfileKnowledgeProvider pkp) {
|
||||
super();
|
||||
|
@ -238,6 +239,7 @@ public class StructureMapUtilities {
|
|||
this.pkp = pkp;
|
||||
fpe = new FHIRPathEngine(worker);
|
||||
fpe.setHostServices(new FFHIRPathHostServices());
|
||||
profileUtilities = new ProfileUtilities(worker, null, null);
|
||||
}
|
||||
|
||||
public StructureMapUtilities(IWorkerContext worker, ITransformerServices services) {
|
||||
|
@ -246,6 +248,7 @@ public class StructureMapUtilities {
|
|||
this.services = services;
|
||||
fpe = new FHIRPathEngine(worker);
|
||||
fpe.setHostServices(new FFHIRPathHostServices());
|
||||
profileUtilities = new ProfileUtilities(worker, null, null);
|
||||
}
|
||||
|
||||
public StructureMapUtilities(IWorkerContext worker) {
|
||||
|
@ -253,6 +256,8 @@ public class StructureMapUtilities {
|
|||
this.worker = worker;
|
||||
fpe = new FHIRPathEngine(worker);
|
||||
fpe.setHostServices(new FFHIRPathHostServices());
|
||||
profileUtilities = new ProfileUtilities(worker, null, null);
|
||||
|
||||
}
|
||||
|
||||
public static String render(StructureMap map) {
|
||||
|
@ -2934,7 +2939,7 @@ public class StructureMapUtilities {
|
|||
|
||||
private void addChildMappings(StringBuilder b, String id, String indent, StructureDefinition sd, ElementDefinition ed, boolean inner) throws DefinitionException {
|
||||
boolean first = true;
|
||||
List<ElementDefinition> children = ProfileUtilities.getChildMap(sd, ed);
|
||||
List<ElementDefinition> children = profileUtilities.getChildMap(sd, ed);
|
||||
for (ElementDefinition child : children) {
|
||||
if (first && inner) {
|
||||
b.append(" then {\r\n");
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class OIDUtils {
|
|||
if (r.equals("2.16.840.1.113883.6.103"))
|
||||
return "http://hl7.org/fhir/sid/icd-9"; //todo: confirm this
|
||||
if (r.equals("2.16.840.1.113883.6.73"))
|
||||
return "http://hl7.org/fhir/sid/atc";
|
||||
return "http://www.whocc.no/atc";
|
||||
if (r.equals("2.16.840.1.113883.3.26.1.1"))
|
||||
return "http://ncimeta.nci.nih.gov";
|
||||
if (r.equals("2.16.840.1.113883.3.26.1.1.1"))
|
||||
|
|
|
@ -77,7 +77,7 @@ import com.google.gson.JsonObject;
|
|||
public class NpmPackage {
|
||||
|
||||
public static boolean isValidName(String pid) {
|
||||
return pid.matches("^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9]*)+$");
|
||||
return pid.matches("^[a-z][a-zA-Z0-9]*(\\.[a-z][a-zA-Z0-9\\-]*)+$");
|
||||
}
|
||||
|
||||
public static boolean isValidVersion(String ver) {
|
||||
|
@ -200,7 +200,7 @@ public class NpmPackage {
|
|||
|
||||
File dir = new File(path);
|
||||
for (File f : dir.listFiles()) {
|
||||
if (!Utilities.existsInList(f.getName(), ".git", ".svn") && !Utilities.existsInList(f.getName(), exemptions)) {
|
||||
if (!isInternalExemptFile(f) && !Utilities.existsInList(f.getName(), exemptions)) {
|
||||
if (f.isDirectory()) {
|
||||
String d = f.getName();
|
||||
if (!d.equals("package")) {
|
||||
|
@ -227,6 +227,10 @@ public class NpmPackage {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isInternalExemptFile(File f) {
|
||||
return Utilities.existsInList(f.getName(), ".git", ".svn") || Utilities.existsInList(f.getName(), "package-list.json");
|
||||
}
|
||||
|
||||
private static void loadSubFolders(NpmPackage res, String rootPath, File dir) throws IOException {
|
||||
for (File f : dir.listFiles()) {
|
||||
if (f.isDirectory()) {
|
||||
|
@ -684,7 +688,7 @@ public class NpmPackage {
|
|||
|
||||
for (NpmPackageFolder folder : folders.values()) {
|
||||
String n = folder.name;
|
||||
if (!"package".equals(n)) {
|
||||
if (!"package".equals(n) && !(n.startsWith("package/") || n.startsWith("package\\"))) {
|
||||
n = "package/"+n;
|
||||
}
|
||||
NpmPackageIndexBuilder indexer = new NpmPackageIndexBuilder();
|
||||
|
@ -826,9 +830,9 @@ public class NpmPackage {
|
|||
public void loadAllFiles() throws IOException {
|
||||
for (String folder : folders.keySet()) {
|
||||
NpmPackageFolder pf = folders.get(folder);
|
||||
String p = Utilities.path(path, folder);
|
||||
String p = folder.contains("$") ? path : Utilities.path(path, folder);
|
||||
for (File f : new File(p).listFiles()) {
|
||||
if (!f.isDirectory()) {
|
||||
if (!f.isDirectory() && !isInternalExemptFile(f)) {
|
||||
pf.getContent().put(f.getName(), TextFile.fileToBytes(f));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,9 +84,12 @@ public class PackageCacheManager {
|
|||
|
||||
public InputStream stream;
|
||||
public String url;
|
||||
public InputStreamWithSrc(InputStream stream, String url) {
|
||||
public String version;
|
||||
|
||||
public InputStreamWithSrc(InputStream stream, String url, String version) {
|
||||
this.stream = stream;
|
||||
this.url = url;
|
||||
this.version = version;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,10 +319,16 @@ public class PackageCacheManager {
|
|||
PackageClient pc = new PackageClient(PRIMARY_SERVER);
|
||||
InputStream stream;
|
||||
try {
|
||||
if (Utilities.noString(v)) {
|
||||
v = pc.getLatestVersion(id);
|
||||
}
|
||||
stream = pc.fetch(id, v);
|
||||
} catch (IOException e) {
|
||||
pc = new PackageClient(SECONDARY_SERVER);
|
||||
try {
|
||||
if (Utilities.noString(v)) {
|
||||
v = pc.getLatestVersion(id);
|
||||
}
|
||||
stream = pc.fetch(id, v);
|
||||
} catch (IOException e1) {
|
||||
// ok, well, we'll try the old way
|
||||
|
@ -329,7 +338,7 @@ public class PackageCacheManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
return new InputStreamWithSrc(stream, pc.url(id, v));
|
||||
return new InputStreamWithSrc(stream, pc.url(id, v), v);
|
||||
}
|
||||
|
||||
|
||||
|
@ -547,12 +556,8 @@ public class PackageCacheManager {
|
|||
}
|
||||
|
||||
public NpmPackage loadPackage(String id, String v) throws FHIRException, IOException {
|
||||
if (Utilities.noString(v)) {
|
||||
throw new FHIRException("Invalid version - ''");
|
||||
}
|
||||
|
||||
//ok, try to resolve locally
|
||||
if (v.startsWith("file:")) {
|
||||
if (!Utilities.noString(v) && v.startsWith("file:")) {
|
||||
return loadPackageFromFile(id, v.substring(5));
|
||||
}
|
||||
NpmPackage p = loadPackageFromCacheOnly(id, v);
|
||||
|
@ -580,7 +585,7 @@ public class PackageCacheManager {
|
|||
} else {
|
||||
source = loadFromPackageServer(id, v);
|
||||
}
|
||||
return addPackageToCache(id, v, source.stream, source.url);
|
||||
return addPackageToCache(id, v == null ? source.version : v, source.stream, source.url);
|
||||
}
|
||||
|
||||
|
||||
|
@ -607,10 +612,10 @@ public class PackageCacheManager {
|
|||
checkBuildLoaded();
|
||||
if (ciList.containsKey(id)) {
|
||||
InputStream stream = fetchFromUrlSpecific(Utilities.pathURL(ciList.get(id), "package.tgz"), false);
|
||||
return new InputStreamWithSrc(stream, Utilities.pathURL(ciList.get(id), "package.tgz"));
|
||||
return new InputStreamWithSrc(stream, Utilities.pathURL(ciList.get(id), "package.tgz"), "current");
|
||||
} else if (id.startsWith("hl7.fhir.r5")) {
|
||||
InputStream stream = fetchFromUrlSpecific(Utilities.pathURL("http://hl7.org/fhir/2020Feb", id+".tgz"), false);
|
||||
return new InputStreamWithSrc(stream, Utilities.pathURL("http://hl7.org/fhir/2020Feb", id+".tgz"));
|
||||
return new InputStreamWithSrc(stream, Utilities.pathURL("http://hl7.org/fhir/2020Feb", id+".tgz"), "current");
|
||||
} else {
|
||||
throw new FHIRException("The package '"+id+"' has not entry on the current build server");
|
||||
}
|
||||
|
|
|
@ -11,9 +11,11 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.exceptions.FHIRException;
|
||||
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
|
||||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
import org.hl7.fhir.utilities.VersionUtilities;
|
||||
import org.hl7.fhir.utilities.cache.PackageClient.PackageInfo;
|
||||
import org.hl7.fhir.utilities.json.JSONUtil;
|
||||
|
||||
|
@ -173,6 +175,21 @@ public class PackageClient {
|
|||
public String url(String id, String v) {
|
||||
return Utilities.pathURL(address, id, v);
|
||||
}
|
||||
|
||||
public String getLatestVersion(String id) throws IOException {
|
||||
List<PackageInfo> list = getVersions(id);
|
||||
if (list.isEmpty()) {
|
||||
throw new IOException("Package not found: "+id);
|
||||
} else {
|
||||
String v = list.get(0).version;
|
||||
for (PackageInfo p : list) {
|
||||
if (VersionUtilities.isThisOrLater(v, p.version)) {
|
||||
v = p.version;
|
||||
}
|
||||
}
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,8 @@ import java.util.Stack;
|
|||
import org.hl7.fhir.utilities.TextFile;
|
||||
import org.hl7.fhir.utilities.Utilities;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonNull;
|
||||
|
@ -618,6 +620,23 @@ public class JsonTrackingParser {
|
|||
public void setErrorOnDuplicates(boolean errorOnDuplicates) {
|
||||
this.errorOnDuplicates = errorOnDuplicates;
|
||||
}
|
||||
|
||||
|
||||
public static void write(JsonObject json, File file) throws IOException {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jcnt = gson.toJson(json);
|
||||
TextFile.stringToFile(jcnt, file);
|
||||
}
|
||||
|
||||
public static void write(JsonObject json, String fileName) throws IOException {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jcnt = gson.toJson(json);
|
||||
TextFile.stringToFile(jcnt, fileName);
|
||||
}
|
||||
|
||||
public static String write(JsonObject json) {
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
return gson.toJson(json);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ValidationOptions {
|
|||
|
||||
public ValidationOptions guessSystem() {
|
||||
ValidationOptions n = this.copy();
|
||||
n.guessSystem = false;
|
||||
n.guessSystem = true;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -52,8 +52,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
|
||||
|
@ -62,7 +63,19 @@ import org.hl7.fhir.utilities.validation.ValidationMessage.Source;
|
|||
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() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a rule and add a {@link IssueSeverity#FATAL} validation message if the validation fails
|
||||
*
|
||||
|
@ -70,6 +83,7 @@ public class BaseValidator {
|
|||
* Set this parameter to <code>false</code> if the validation does not pass
|
||||
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
|
||||
*/
|
||||
//todo: remove after i18n implementation done
|
||||
protected boolean fail(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg) {
|
||||
if (!thePass) {
|
||||
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.FATAL);
|
||||
|
@ -77,6 +91,14 @@ public class BaseValidator {
|
|||
return thePass;
|
||||
}
|
||||
|
||||
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);
|
||||
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.FATAL);
|
||||
}
|
||||
return thePass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a rule and add a {@link IssueSeverity#FATAL} validation message if the validation fails
|
||||
*
|
||||
|
@ -121,12 +143,16 @@ public class BaseValidator {
|
|||
return thePass;
|
||||
}
|
||||
|
||||
|
||||
private String formatMessage(String theMessage, Object... theMessageArguments) {
|
||||
String message;
|
||||
if (theMessageArguments != null && theMessageArguments.length > 0) {
|
||||
message = MessageFormat.format(theMessage, theMessageArguments);
|
||||
} else {
|
||||
|
||||
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;
|
||||
|
@ -145,11 +171,12 @@ public class BaseValidator {
|
|||
*/
|
||||
protected boolean hint(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, String msg) {
|
||||
if (!thePass) {
|
||||
addValidationMessage(errors, type, line, col, path, msg, IssueSeverity.INFORMATION);
|
||||
String message = formatMessage(msg);
|
||||
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.INFORMATION);
|
||||
}
|
||||
return thePass;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test a rule and add a {@link IssueSeverity#INFORMATION} validation message if the validation fails. And mark it as a slicing hint for later recovery if appropriate
|
||||
*
|
||||
|
@ -279,6 +306,8 @@ public class BaseValidator {
|
|||
* Set this parameter to <code>false</code> if the validation does not pass
|
||||
* @return Returns <code>thePass</code> (in other words, returns <code>true</code> if the rule did not fail validation)
|
||||
*/
|
||||
|
||||
//todo: delete this when finished i18n
|
||||
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String msg) {
|
||||
if (!thePass) {
|
||||
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR);
|
||||
|
@ -286,6 +315,14 @@ public class BaseValidator {
|
|||
return thePass;
|
||||
}
|
||||
|
||||
protected boolean rule(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, String theMessage, Object... theMessageArguments) {
|
||||
if (!thePass) {
|
||||
String message = formatMessage(theMessage, theMessageArguments);
|
||||
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR);
|
||||
}
|
||||
return thePass;
|
||||
}
|
||||
|
||||
public boolean rule(List<ValidationMessage> errors, Source source, IssueType type, String path, boolean thePass, String msg) {
|
||||
if (!thePass) {
|
||||
addValidationMessage(errors, type, -1, -1, path, msg, IssueSeverity.ERROR, source);
|
||||
|
@ -527,5 +564,4 @@ public class BaseValidator {
|
|||
}
|
||||
return thePass;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -106,19 +106,15 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
*
|
||||
* 1/ Initialize
|
||||
* ValidationEngine validator = new ValidationEngine(src);
|
||||
* - this must refer to the igpack.zip for the version of the spec against which you want to validate
|
||||
* it can be a url or a file reference. It can nominate the igpack.zip directly,
|
||||
* or it can name the container alone (e.g. just the spec URL).
|
||||
* The validation engine does not cache igpack.zip. the user must manage that if desired
|
||||
* - this must be the packageId of the relevant core specification
|
||||
* for the version you want to validate against (e.g. hl7.fhir.r4.core)
|
||||
*
|
||||
* validator.connectToTSServer(txServer);
|
||||
* - this is optional; in the absence of a terminology service, snomed, loinc etc will not be validated
|
||||
*
|
||||
* validator.loadIg(src);
|
||||
* - call this any number of times for the Implementation Guide(s) of interest. This is a reference
|
||||
* to the igpack.zip for the implementation guide - same rules as above
|
||||
* the version of the IGPack must match that of the spec
|
||||
* Alternatively it can point to a local folder that contains conformance resources.
|
||||
* - call this any number of times for the Implementation Guide(s) of interest.
|
||||
* - See https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator for documentation about the src parameter (-ig parameter)
|
||||
*
|
||||
* validator.loadQuestionnaire(src)
|
||||
* - url or filename of a questionnaire to load. Any loaded questionnaires will be used while validating
|
||||
|
@ -136,7 +132,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
* if the source is provided as byte[] or stream, you need to provide a format too, though you can
|
||||
* leave that as null, and the validator will guess
|
||||
*
|
||||
* 3. Or, instead of validating, transform
|
||||
* 3. Or, instead of validating, transform (see documentation and use in Validator.java)
|
||||
*
|
||||
* @author Grahame Grieve
|
||||
*
|
||||
*/
|
||||
|
@ -309,17 +306,19 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
|||
this.anyExtensionsAllowed = anyExtensionsAllowed;
|
||||
}
|
||||
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer) throws Exception {
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, boolean canRunWithoutTerminologyServer, String vString) throws Exception {
|
||||
pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
|
||||
loadInitialDefinitions(src);
|
||||
context.setCanRunWithoutTerminology(canRunWithoutTerminologyServer);
|
||||
setTerminologyServer(txsrvr, txLog, version);
|
||||
this.version = vString;
|
||||
}
|
||||
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version) throws Exception {
|
||||
public ValidationEngine(String src, String txsrvr, String txLog, FhirPublication version, String vString) throws Exception {
|
||||
pcm = new PackageCacheManager(true, ToolsVersion.TOOLS_VERSION);
|
||||
loadInitialDefinitions(src);
|
||||
setTerminologyServer(txsrvr, txLog, version);
|
||||
this.version = vString;
|
||||
}
|
||||
|
||||
public ValidationEngine(String src) throws Exception {
|
||||
|
@ -342,7 +341,7 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
|||
context = SimpleWorkerContext.fromDefinitions(source, loaderForVersion());
|
||||
context.setAllowLoadingDuplicates(true); // because of Forge
|
||||
context.setExpansionProfile(makeExpProfile());
|
||||
NpmPackage npm = pcm.loadPackage("hl7.fhir.xver-extensions", "0.0.1");
|
||||
NpmPackage npm = pcm.loadPackage("hl7.fhir.xver-extensions", "0.0.2");
|
||||
context.loadFromPackage(npm, null);
|
||||
grabNatives(source, "http://hl7.org/fhir");
|
||||
}
|
||||
|
@ -547,8 +546,10 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
|||
}
|
||||
|
||||
private boolean isIgnoreFile(File ff) {
|
||||
return Utilities.existsInList(ff.getName(), ".DS_Store") || Utilities.existsInList(Utilities.getFileExtension(ff.getName()).toLowerCase(), "md", "css", "js", "png", "gif", "jpg", "html", "tgz", "pack", "zip");
|
||||
|
||||
if (ff.getName().startsWith(".")|| ff.getAbsolutePath().contains(".git")){
|
||||
return true;
|
||||
}
|
||||
return Utilities.existsInList(Utilities.getFileExtension(ff.getName()).toLowerCase(), "md", "css", "js", "png", "gif", "jpg", "html", "tgz", "pack", "zip");
|
||||
}
|
||||
|
||||
private Map<String, byte[]> loadPackage(InputStream stream, String name) throws Exception {
|
||||
|
@ -1206,7 +1207,7 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
|||
}
|
||||
|
||||
if(structureDefinition == null)
|
||||
throw new FHIRException("Unable to determine StructureDefinition for target type");
|
||||
throw new FHIRException("Unable to find StructureDefinition for target type ('"+targetTypeUrl+"')");
|
||||
|
||||
return Manager.build(getContext(), structureDefinition);
|
||||
}
|
||||
|
@ -1691,6 +1692,338 @@ public class ValidationEngine implements IValidatorResourceFetcher {
|
|||
this.assumeValidRestReferences = assumeValidRestReferences;
|
||||
}
|
||||
|
||||
public byte[] transformVersion(String source, String targetVer, FhirFormat format, Boolean canDoNative) throws FHIRException, IOException, Exception {
|
||||
Content cnt = loadContent(source, "validate");
|
||||
org.hl7.fhir.r5.elementmodel.Element src = Manager.parse(context, new ByteArrayInputStream(cnt.focus), cnt.cntType);
|
||||
|
||||
// if the src has a url, we try to use the java code
|
||||
if ((canDoNative == null && src.hasChild("url")) || (canDoNative != null && canDoNative)) {
|
||||
try {
|
||||
if (VersionUtilities.isR2Ver(version)) {
|
||||
return convertVersionNativeR2(targetVer, cnt, format);
|
||||
} else if (VersionUtilities.isR2BVer(version)) {
|
||||
return convertVersionNativeR2b(targetVer, cnt, format);
|
||||
} else if (VersionUtilities.isR3Ver(version)) {
|
||||
return convertVersionNativeR3(targetVer, cnt, format);
|
||||
} else if (VersionUtilities.isR4Ver(version)) {
|
||||
return convertVersionNativeR4(targetVer, cnt, format);
|
||||
} else {
|
||||
throw new Exception("Source version not supported yet: "+version);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Conversion failed using Java convertor: "+e.getMessage());
|
||||
}
|
||||
}
|
||||
// ok, we try converting using the structure maps
|
||||
System.out.println("Loading hl7.fhir.xver.r4");
|
||||
loadIg("hl7.fhir.xver.r4", false);
|
||||
String type = src.fhirType();
|
||||
String url = getMapId(type, targetVer);
|
||||
List<Base> outputs = new ArrayList<Base>();
|
||||
StructureMapUtilities scu = new StructureMapUtilities(context, new TransformSupportServices(outputs));
|
||||
StructureMap map = context.getTransform(url);
|
||||
if (map == null)
|
||||
throw new Error("Unable to find map "+url+" (Known Maps = "+context.listMapUrls()+")");
|
||||
org.hl7.fhir.r5.elementmodel.Element resource = getTargetResourceFromStructureMap(map);
|
||||
scu.transform(null, src, map, resource);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
Manager.compose(context, resource, bs, format, OutputStyle.PRETTY, null);
|
||||
return bs.toByteArray();
|
||||
}
|
||||
|
||||
private String getMapId(String type, String targetVer) {
|
||||
if (VersionUtilities.isR2Ver(version)) {
|
||||
if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
return "http://hl7.org/fhir/StructureMap/"+type+"2to3";
|
||||
}
|
||||
} else if (VersionUtilities.isR3Ver(version)) {
|
||||
if (VersionUtilities.isR2Ver(targetVer)) {
|
||||
return "http://hl7.org/fhir/StructureMap/"+type+"3to2";
|
||||
} else if (VersionUtilities.isR4Ver(targetVer)) {
|
||||
return "http://hl7.org/fhir/StructureMap/"+type+"3to4";
|
||||
}
|
||||
} else if (VersionUtilities.isR4Ver(version)) {
|
||||
if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
return "http://hl7.org/fhir/StructureMap/"+type+"4to3";
|
||||
}
|
||||
}
|
||||
throw new FHIRException("Source/Target version not supported: "+version+" -> "+targetVer);
|
||||
}
|
||||
|
||||
}
|
||||
public byte[] convertVersionNativeR2(String targetVer, Content cnt, FhirFormat format) throws IOException, Exception {
|
||||
org.hl7.fhir.dstu2.model.Resource r2;
|
||||
switch (cnt.cntType) {
|
||||
case JSON:
|
||||
r2 = new org.hl7.fhir.dstu2.formats.JsonParser().parse(cnt.focus);
|
||||
break;
|
||||
case XML:
|
||||
r2 = new org.hl7.fhir.dstu2.formats.XmlParser().parse(cnt.focus);
|
||||
break;
|
||||
default:
|
||||
throw new FHIRException("Unsupported input format: "+cnt.cntType.toString());
|
||||
}
|
||||
if (VersionUtilities.isR2Ver(targetVer)) {
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2.formats.JsonParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2.formats.XmlParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR2BVer(targetVer)) {
|
||||
org.hl7.fhir.dstu3.model.Resource r3 = VersionConvertor_10_30.convertResource(r2);
|
||||
org.hl7.fhir.dstu2016may.model.Resource r2b = VersionConvertor_14_30.convertResource(r3);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2016may.formats.JsonParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu3.model.Resource r3 = VersionConvertor_10_30.convertResource(r2);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu3.formats.JsonParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu3.formats.XmlParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR4Ver(targetVer)) {
|
||||
org.hl7.fhir.r4.model.Resource r4 = VersionConvertor_10_40.convertResource(r2);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.r4.formats.JsonParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.r4.formats.XmlParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Target Version not supported yet: "+targetVer);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] convertVersionNativeR2b(String targetVer, Content cnt, FhirFormat format) throws IOException, Exception {
|
||||
org.hl7.fhir.dstu2016may.model.Resource r2b;
|
||||
switch (cnt.cntType) {
|
||||
case JSON:
|
||||
r2b = new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(cnt.focus);
|
||||
break;
|
||||
case XML:
|
||||
r2b = new org.hl7.fhir.dstu2016may.formats.XmlParser().parse(cnt.focus);
|
||||
break;
|
||||
default:
|
||||
throw new FHIRException("Unsupported input format: "+cnt.cntType.toString());
|
||||
}
|
||||
if (VersionUtilities.isR2Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu3.model.Resource r3 = VersionConvertor_14_30.convertResource(r2b);
|
||||
org.hl7.fhir.dstu2.model.Resource r2 = VersionConvertor_10_30.convertResource(r3);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2.formats.JsonParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2.formats.XmlParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR2BVer(targetVer)) {
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2016may.formats.JsonParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu3.model.Resource r3 = VersionConvertor_14_30.convertResource(r2b);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu3.formats.JsonParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu3.formats.XmlParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR4Ver(targetVer)) {
|
||||
org.hl7.fhir.r4.model.Resource r4 = VersionConvertor_14_40.convertResource(r2b);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.r4.formats.JsonParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.r4.formats.XmlParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Target Version not supported yet: "+targetVer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public byte[] convertVersionNativeR3(String targetVer, Content cnt, FhirFormat format) throws IOException, Exception {
|
||||
org.hl7.fhir.dstu3.model.Resource r3;
|
||||
switch (cnt.cntType) {
|
||||
case JSON:
|
||||
r3 = new org.hl7.fhir.dstu3.formats.JsonParser().parse(cnt.focus);
|
||||
break;
|
||||
case XML:
|
||||
r3 = new org.hl7.fhir.dstu3.formats.XmlParser().parse(cnt.focus);
|
||||
break;
|
||||
default:
|
||||
throw new FHIRException("Unsupported input format: "+cnt.cntType.toString());
|
||||
}
|
||||
if (VersionUtilities.isR2Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu2.model.Resource r2 = VersionConvertor_10_30.convertResource(r3);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2.formats.JsonParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2.formats.XmlParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR2BVer(targetVer)) {
|
||||
org.hl7.fhir.dstu2016may.model.Resource r2b = VersionConvertor_14_30.convertResource(r3);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2016may.formats.JsonParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu3.formats.JsonParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu3.formats.XmlParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR4Ver(targetVer)) {
|
||||
org.hl7.fhir.r4.model.Resource r4 = VersionConvertor_30_40.convertResource(r3, false);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.r4.formats.JsonParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.r4.formats.XmlParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Target Version not supported yet: "+targetVer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public byte[] convertVersionNativeR4(String targetVer, Content cnt, FhirFormat format) throws IOException, Exception {
|
||||
org.hl7.fhir.r4.model.Resource r4;
|
||||
switch (cnt.cntType) {
|
||||
case JSON:
|
||||
r4 = new org.hl7.fhir.r4.formats.JsonParser().parse(cnt.focus);
|
||||
break;
|
||||
case XML:
|
||||
r4 = new org.hl7.fhir.r4.formats.XmlParser().parse(cnt.focus);
|
||||
break;
|
||||
default:
|
||||
throw new FHIRException("Unsupported input format: "+cnt.cntType.toString());
|
||||
}
|
||||
if (VersionUtilities.isR2Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu2.model.Resource r2 = VersionConvertor_10_40.convertResource(r4);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2.formats.JsonParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2.formats.XmlParser().compose(bs, r2);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR2BVer(targetVer)) {
|
||||
org.hl7.fhir.dstu2016may.model.Resource r2b = VersionConvertor_14_40.convertResource(r4);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu2016may.formats.JsonParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu2016may.formats.XmlParser().compose(bs, r2b);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR3Ver(targetVer)) {
|
||||
org.hl7.fhir.dstu3.model.Resource r3 = VersionConvertor_30_40.convertResource(r4, false);
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.dstu3.formats.JsonParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.dstu3.formats.XmlParser().compose(bs, r3);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else if (VersionUtilities.isR4Ver(targetVer)) {
|
||||
ByteArrayOutputStream bs = new ByteArrayOutputStream();
|
||||
switch (format) {
|
||||
case JSON:
|
||||
new org.hl7.fhir.r4.formats.JsonParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
case XML:
|
||||
new org.hl7.fhir.r4.formats.XmlParser().compose(bs, r4);
|
||||
return bs.toByteArray();
|
||||
default:
|
||||
throw new FHIRException("Unsupported output format: "+cnt.cntType.toString());
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Target Version not supported yet: "+targetVer);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -62,6 +62,7 @@ import java.util.UUID;
|
|||
import org.hl7.fhir.r5.conformance.CapabilityStatementUtilities;
|
||||
import org.hl7.fhir.r5.conformance.CapabilityStatementUtilities.CapabilityStatementComparisonOutput;
|
||||
import org.hl7.fhir.r5.conformance.ProfileComparer;
|
||||
import org.hl7.fhir.r5.elementmodel.Manager.FhirFormat;
|
||||
import org.hl7.fhir.r5.formats.IParser;
|
||||
import org.hl7.fhir.r5.formats.IParser.OutputStyle;
|
||||
import org.hl7.fhir.r5.formats.XmlParser;
|
||||
|
@ -105,7 +106,7 @@ import org.hl7.fhir.utilities.validation.ValidationMessage;
|
|||
public class Validator {
|
||||
|
||||
public enum EngineMode {
|
||||
VALIDATION, TRANSFORM, NARRATIVE, SNAPSHOT, SCAN, CONVERT, FHIRPATH
|
||||
VALIDATION, TRANSFORM, NARRATIVE, SNAPSHOT, SCAN, CONVERT, FHIRPATH, VERSION
|
||||
}
|
||||
|
||||
private static String getNamedParam(String[] args, String param) {
|
||||
|
@ -156,7 +157,7 @@ public class Validator {
|
|||
System.out.println("If requested, instances will also be verified against the appropriate schema");
|
||||
System.out.println("W3C XML Schema, JSON schema or ShEx, as appropriate");
|
||||
System.out.println("");
|
||||
System.out.println("Usage: org.hl7.fhir.r5.validation.ValidationEngine (parameters)");
|
||||
System.out.println("Usage: java -jar [validator].jar (parameters)");
|
||||
System.out.println("");
|
||||
System.out.println("The following parameters are supported:");
|
||||
System.out.println("[source]: a file, url, directory or pattern for resources to validate. At");
|
||||
|
@ -316,7 +317,7 @@ public class Validator {
|
|||
}
|
||||
String definitions = VersionUtilities.packageForVersion(v)+"#"+v;
|
||||
System.out.println("Loading (v = "+v+", tx server http://tx.fhir.org)");
|
||||
ValidationEngine validator = new ValidationEngine(definitions, "http://tx.fhir.org", txLog, FhirPublication.fromCode(v));
|
||||
ValidationEngine validator = new ValidationEngine(definitions, "http://tx.fhir.org", txLog, FhirPublication.fromCode(v), v);
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
if ("-ig".equals(args[i])) {
|
||||
if (i+1 == args.length)
|
||||
|
@ -325,7 +326,6 @@ public class Validator {
|
|||
String s = args[++i];
|
||||
if (!s.startsWith("hl7.fhir.core-")) {
|
||||
System.out.println("Load Package: "+s);
|
||||
validator.loadIg(s, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,6 +402,7 @@ public class Validator {
|
|||
List<String> profiles = new ArrayList<String>();
|
||||
EngineMode mode = EngineMode.VALIDATION;
|
||||
String output = null;
|
||||
Boolean canDoNative = null;
|
||||
List<String> sources= new ArrayList<String>();
|
||||
Map<String, String> locations = new HashMap<String, String>();
|
||||
String sv = "current";
|
||||
|
@ -410,6 +411,7 @@ public class Validator {
|
|||
String lang = null;
|
||||
String fhirpath = null;
|
||||
String snomedCT = "900000000000207008";
|
||||
String targetVer = null;
|
||||
boolean doDebug = false;
|
||||
boolean assumeValidRestReferences = false;
|
||||
|
||||
|
@ -423,6 +425,8 @@ public class Validator {
|
|||
throw new Error("Specified -output without indicating output file");
|
||||
else
|
||||
output = args[++i];
|
||||
} else if (args[i].equals("-proxy")) {
|
||||
i++; // ignore next parameter
|
||||
} else if (args[i].equals("-profile")) {
|
||||
String p = null;
|
||||
if (i+1 == args.length)
|
||||
|
@ -477,6 +481,13 @@ public class Validator {
|
|||
anyExtensionsAllowed = false;
|
||||
} else if (args[i].equals("-hintAboutNonMustSupport")) {
|
||||
hintAboutNonMustSupport = true;
|
||||
} else if (args[i].equals("-to-version")) {
|
||||
targetVer = args[++i];
|
||||
mode = EngineMode.VERSION;
|
||||
} else if (args[i].equals("-do-native")) {
|
||||
canDoNative = true;
|
||||
} else if (args[i].equals("-no-native")) {
|
||||
canDoNative = false;
|
||||
} else if (args[i].equals("-transform")) {
|
||||
map = args[++i];
|
||||
mode = EngineMode.TRANSFORM;
|
||||
|
@ -562,11 +573,9 @@ public class Validator {
|
|||
String definitions = VersionUtilities.packageForVersion(sv)+"#"+VersionUtilities.getCurrentVersion(sv);
|
||||
System.out.println(" .. FHIR Version "+sv+", definitions from "+definitions);
|
||||
System.out.println(" .. connect to tx server @ "+txServer);
|
||||
ValidationEngine validator = new ValidationEngine(definitions, txServer, txLog, FhirPublication.fromCode(sv));
|
||||
ValidationEngine validator = new ValidationEngine(definitions, txServer, txLog, FhirPublication.fromCode(sv), sv);
|
||||
validator.setDebug(doDebug);
|
||||
System.out.println(" (v"+validator.getContext().getVersion()+")");
|
||||
if (sv != null)
|
||||
validator.setVersion(sv);
|
||||
for (String src : igs) {
|
||||
System.out.println("+ .. load IG from "+src);
|
||||
validator.loadIg(src, recursive);
|
||||
|
@ -586,7 +595,28 @@ public class Validator {
|
|||
x = new XmlParser();
|
||||
x.setOutputStyle(OutputStyle.PRETTY);
|
||||
|
||||
if (mode == EngineMode.TRANSFORM) {
|
||||
if (mode == EngineMode.VERSION) {
|
||||
if (sources.size() > 1) {
|
||||
throw new Exception("Can only have one source when converting versions (found "+sources+")");
|
||||
}
|
||||
if (targetVer == null) {
|
||||
throw new Exception("Must provide a map when converting versions");
|
||||
}
|
||||
if (output == null) {
|
||||
throw new Exception("Must nominate an output when converting versions");
|
||||
}
|
||||
try {
|
||||
if (mapLog != null) {
|
||||
validator.setMapLog(mapLog);
|
||||
}
|
||||
byte[] r = validator.transformVersion(sources.get(0), targetVer, output.endsWith(".json") ? FhirFormat.JSON : FhirFormat.XML, canDoNative);
|
||||
System.out.println(" ...success");
|
||||
TextFile.bytesToFile(r, output);
|
||||
} catch (Exception e) {
|
||||
System.out.println(" ...Failure: "+e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (mode == EngineMode.TRANSFORM) {
|
||||
if (sources.size() > 1)
|
||||
throw new Exception("Can only have one source when doing a transform (found "+sources+")");
|
||||
if (txServer == null)
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.r5.context.IWorkerContext;
|
||||
import org.hl7.fhir.r5.model.CodeSystem;
|
||||
import org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent;
|
||||
import org.hl7.fhir.utilities.validation.ValidationMessage;
|
||||
|
@ -34,6 +35,10 @@ import org.hl7.fhir.validation.BaseValidator;
|
|||
|
||||
public class CodeSystemValidator extends BaseValidator {
|
||||
|
||||
public CodeSystemValidator(IWorkerContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public List<ValidationMessage> validate(CodeSystem cs, boolean forBuild) {
|
||||
List<ValidationMessage> errors = new ArrayList<ValidationMessage>();
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -37,12 +37,11 @@ import org.hl7.fhir.validation.BaseValidator;
|
|||
|
||||
public class ProfileValidator extends BaseValidator {
|
||||
|
||||
IWorkerContext context;
|
||||
private boolean checkAggregation = false;
|
||||
private boolean checkMustSupport = false;
|
||||
|
||||
public void setContext(IWorkerContext context) {
|
||||
this.context = context;
|
||||
public ProfileValidator(IWorkerContext context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public boolean isCheckAggregation() {
|
||||
|
|
|
@ -0,0 +1,272 @@
|
|||
package org.hl7.fhir.validation.utils;
|
||||
|
||||
public class I18nConstants {
|
||||
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_CANONICAL = "Bundle_BUNDLE_Entry_Canonical";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_DOCUMENT = "Bundle_BUNDLE_Entry_Document";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_IDURLMISMATCH = "Bundle_BUNDLE_Entry_IdUrlMismatch";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_MISMATCHIDURL = "Bundle_BUNDLE_Entry_MismatchIdUrl";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_NOFIRST = "Bundle_BUNDLE_Entry_NoFirst";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_NOFIRSTRESOURCE = "Bundle_BUNDLE_Entry_NoFirstResource";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_NOFULLURL = "Bundle_BUNDLE_Entry_NoFullUrl";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_NOPROFILE = "Bundle_BUNDLE_Entry_NoProfile";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_NOTFOUND = "Bundle_BUNDLE_Entry_NotFound";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_ORPHAN = "Bundle_BUNDLE_Entry_Orphan";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_TYPE = "Bundle_BUNDLE_Entry_Type";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_TYPE2 = "Bundle_BUNDLE_Entry_Type2";
|
||||
public final static String BUNDLE_BUNDLE_ENTRY_TYPE3 = "Bundle_BUNDLE_Entry_Type3";
|
||||
public final static String BUNDLE_BUNDLE_FULLURL_MISSING = "Bundle_BUNDLE_FullUrl_Missing";
|
||||
public final static String BUNDLE_BUNDLE_FULLURL_NEEDVERSION = "Bundle_BUNDLE_FullUrl_NeedVersion";
|
||||
public final static String BUNDLE_BUNDLE_MULTIPLEMATCHES = "Bundle_BUNDLE_MultipleMatches";
|
||||
public final static String BUNDLE_BUNDLE_NOT_LOCAL = "Bundle_BUNDLE_Not_Local";
|
||||
public final static String BUNDLE_MSG_EVENT_COUNT = "Bundle_MSG_Event_Count";
|
||||
public final static String CAPABALITYSTATEMENT_CS_SP_WRONGTYPE = "CapabalityStatement_CS_SP_WrongType";
|
||||
public final static String CODESYSTEM_CS_VS_INCLUDEDETAILS = "CodeSystem_CS_VS_IncludeDetails";
|
||||
public final static String CODESYSTEM_CS_VS_INVALID = "CodeSystem_CS_VS_Invalid";
|
||||
public final static String CODESYSTEM_CS_VS_MISMATCH = "CodeSystem_CS_VS_MisMatch";
|
||||
public final static String CODESYSTEM_CS_VS_WRONGSYSTEM = "CodeSystem_CS_VS_WrongSystem";
|
||||
public final static String EXTENSION_EXT_CONTEXT_WRONG = "Extension_EXT_Context_Wrong";
|
||||
public final static String EXTENSION_EXT_COUNT_MISMATCH = "Extension_EXT_Count_Mismatch";
|
||||
public final static String EXTENSION_EXT_COUNT_NOTFOUND = "Extension_EXT_Count_NotFound";
|
||||
public final static String EXTENSION_EXT_FIXED_BANNED = "Extension_EXT_Fixed_Banned";
|
||||
public final static String EXTENSION_EXT_MODIFIER_MISMATCHN = "Extension_EXT_Modifier_MismatchN";
|
||||
public final static String EXTENSION_EXT_MODIFIER_MISMATCHY = "Extension_EXT_Modifier_MismatchY";
|
||||
public final static String EXTENSION_EXT_MODIFIER_N = "Extension_EXT_Modifier_N";
|
||||
public final static String EXTENSION_EXT_MODIFIER_Y = "Extension_EXT_Modifier_Y";
|
||||
public final static String EXTENSION_EXT_SIMPLE = "Extension_EXT_Simple";
|
||||
public final static String EXTENSION_EXT_SUBEXTENSION_INVALID = "Extension_EXT_SubExtension_Invalid";
|
||||
public final static String EXTENSION_EXT_TYPE = "Extension_EXT_Type";
|
||||
public final static String EXTENSION_EXT_UNKNOWN = "Extension_EXT_Unknown";
|
||||
public final static String EXTENSION_EXT_UNKNOWN_NOTHERE = "Extension_EXT_Unknown_NotHere";
|
||||
public final static String EXTENSION_EXT_URL_ABSOLUTE = "Extension_EXT_URL_Absolute";
|
||||
public final static String EXTENSION_EXT_URL_NOTFOUND = "Extension_EXT_Url_NotFound";
|
||||
public final static String EXTENSION_EXT_VERSION_INTERNAL = "Extension_EXT_Version_Internal";
|
||||
public final static String EXTENSION_EXT_VERSION_INVALID = "Extension_EXT_Version_Invalid";
|
||||
public final static String EXTENSION_EXT_VERSION_INVALIDID = "Extension_EXT_Version_InvalidId";
|
||||
public final static String EXTENSION_EXT_VERSION_NOCHANGE = "Extension_EXT_Version_NoChange";
|
||||
public final static String FIXED_TYPE_CHECKS_DT_ADDRESS_LINE = "Fixed_Type_Checks_DT_Address_Line";
|
||||
public final static String FIXED_TYPE_CHECKS_DT_NAME_FAMILY = "Fixed_Type_Checks_DT_Name_Family";
|
||||
public final static String FIXED_TYPE_CHECKS_DT_NAME_GIVEN = "Fixed_Type_Checks_DT_Name_Given";
|
||||
public final static String FIXED_TYPE_CHECKS_DT_NAME_PREFIX = "Fixed_Type_Checks_DT_Name_Prefix";
|
||||
public final static String FIXED_TYPE_CHECKS_DT_NAME_SUFFIX = "Fixed_Type_Checks_DT_Name_Suffix";
|
||||
public final static String INTERNAL_INT_BAD_TYPE = "Internal_INT_Bad_Type";
|
||||
public final static String LANGUAGE_XHTML_LANG_DIFFERENT1 = "Language_XHTML_Lang_Different1";
|
||||
public final static String LANGUAGE_XHTML_LANG_DIFFERENT2 = "Language_XHTML_Lang_Different2";
|
||||
public final static String LANGUAGE_XHTML_LANG_MISSING1 = "Language_XHTML_Lang_Missing1";
|
||||
public final static String LANGUAGE_XHTML_LANG_MISSING2 = "Language_XHTML_Lang_Missing2";
|
||||
public final static String LANGUAGE_XHTML_LANG_MISSING3 = "Language_XHTML_Lang_Missing3";
|
||||
public final static String META_RES_SECURITY_DUPLICATE = "Meta_RES_Security_Duplicate";
|
||||
public final static String MUSTSUPPORT_VAL_MUSTSUPPORT = "MustSupport_VAL_MustSupport";
|
||||
public final static String PROFILE_EXT_NOT_HERE = "Profile_EXT_Not_Here";
|
||||
public final static String PROFILE_VAL_MISSINGELEMENT = "Profile_VAL_MissingElement";
|
||||
public final static String PROFILE_VAL_NOTALLOWED = "Profile_VAL_NotAllowed";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_BADOPTION = "Questionnaire_QR_Item_BadOption";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_CODING = "Questionnaire_QR_Item_Coding";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_CODINGNOOPTIONS = "Questionnaire_QR_Item_CodingNoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_DATENOOPTIONS = "Questionnaire_QR_Item_DateNoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_DISPLAY = "Questionnaire_QR_Item_Display";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_GROUP = "Questionnaire_QR_Item_Group";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_INTNOOPTIONS = "Questionnaire_QR_Item_IntNoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_MISSING = "Questionnaire_QR_Item_Missing";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOCODING = "Questionnaire_QR_Item_NoCoding";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NODATE = "Questionnaire_QR_Item_NoDate";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOINTEGER = "Questionnaire_QR_Item_NoInteger";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOLINKID = "Questionnaire_QR_Item_NoLinkId";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONS = "Questionnaire_QR_Item_NoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONSCODING = "Questionnaire_QR_Item_NoOptionsCoding";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONSDATE = "Questionnaire_QR_Item_NoOptionsDate";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONSINTEGER = "Questionnaire_QR_Item_NoOptionsInteger";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONSSTRING = "Questionnaire_QR_Item_NoOptionsString";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOOPTIONSTIME = "Questionnaire_QR_Item_NoOptionsTime";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOSTRING = "Questionnaire_QR_Item_NoString";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOTENABLED = "Questionnaire_QR_Item_NotEnabled";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOTENABLED2 = "Questionnaire_QR_Item_NotEnabled2";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOTFOUND = "Questionnaire_QR_Item_NotFound";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOTIME = "Questionnaire_QR_Item_NoTime";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_NOTYPE = "Questionnaire_QR_Item_NoType";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_ONLYONEA = "Questionnaire_QR_Item_OnlyOneA";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_ONLYONEI = "Questionnaire_QR_Item_OnlyOneI";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_ORDER = "Questionnaire_QR_Item_Order";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_STRINGNOOPTIONS = "Questionnaire_QR_Item_StringNoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_TEXT = "Questionnaire_QR_Item_Text";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_TIMENOOPTIONS = "Questionnaire_QR_Item_TimeNoOptions";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_WRONGTYPE = "Questionnaire_QR_Item_WrongType";
|
||||
public final static String QUESTIONNAIRE_QR_ITEM_WRONGTYPE2 = "Questionnaire_QR_Item_WrongType2";
|
||||
public final static String QUESTIONNAIRE_QR_Q_NONE = "Questionnaire_QR_Q_None";
|
||||
public final static String QUESTIONNAIRE_QR_Q_NOTFOUND = "Questionnaire_QR_Q_NotFound";
|
||||
public final static String QUESTIONNAIRE_Q_ENABLEWHEN_AFTER = "Questionnaire_Q_EnableWhen_After";
|
||||
public final static String QUESTIONNAIRE_Q_ENABLEWHEN_ISINNER = "Questionnaire_Q_EnableWhen_IsInner";
|
||||
public final static String QUESTIONNAIRE_Q_ENABLEWHEN_NOLINK = "Questionnaire_Q_EnableWhen_NoLink";
|
||||
public final static String QUESTIONNAIRE_Q_ENABLEWHEN_NOTARGET = "Questionnaire_Q_EnableWhen_NoTarget";
|
||||
public final static String QUESTIONNAIRE_Q_ENABLEWHEN_SELF = "Questionnaire_Q_EnableWhen_Self";
|
||||
public final static String REFERENCE_REF_AGGREGATION = "Reference_REF_Aggregation";
|
||||
public final static String REFERENCE_REF_BADTARGETTYPE = "Reference_REF_BadTargetType";
|
||||
public final static String REFERENCE_REF_BADTARGETTYPE2 = "Reference_REF_BadTargetType2";
|
||||
public final static String REFERENCE_REF_CANTMATCHCHOICE = "Reference_REF_CantMatchChoice";
|
||||
public final static String REFERENCE_REF_CANTMATCHTYPE = "Reference_REF_CantMatchType";
|
||||
public final static String REFERENCE_REF_CANTRESOLVE = "Reference_REF_CantResolve";
|
||||
public final static String REFERENCE_REF_CANTRESOLVEPROFILE = "Reference_REF_CantResolveProfile";
|
||||
public final static String REFERENCE_REF_FORMAT1 = "Reference_REF_Format1";
|
||||
public final static String REFERENCE_REF_FORMAT2 = "Reference_REF_Format2";
|
||||
public final static String REFERENCE_REF_MULTIPLEMATCHES = "Reference_REF_MultipleMatches";
|
||||
public final static String REFERENCE_REF_NODISPLAY = "Reference_REF_NoDisplay";
|
||||
public final static String REFERENCE_REF_NOTFOUND_BUNDLE = "Reference_REF_NotFound_Bundle";
|
||||
public final static String REFERENCE_REF_NOTYPE = "Reference_REF_NoType";
|
||||
public final static String REFERENCE_REF_RESOURCETYPE = "Reference_REF_ResourceType";
|
||||
public final static String REFERENCE_REF_WRONGTARGET = "Reference_REF_WrongTarget";
|
||||
public final static String RESOURCE_RES_ID_MISSING = "Resource_RES_ID_Missing";
|
||||
public final static String RESOURCE_RES_ID_PROHIBITED = "Resource_RES_ID_Prohibited";
|
||||
public final static String TERMINOLOGY_PASSTHROUGH_TX_MESSAGE = "Terminology_PassThrough_TX_Message";
|
||||
public final static String TERMINOLOGY_TX_BINDING_CANTCHECK = "Terminology_TX_Binding_CantCheck";
|
||||
public final static String TERMINOLOGY_TX_BINDING_MISSING = "Terminology_TX_Binding_Missing";
|
||||
public final static String TERMINOLOGY_TX_BINDING_MISSING2 = "Terminology_TX_Binding_Missing2";
|
||||
public final static String TERMINOLOGY_TX_BINDING_NOSERVER = "Terminology_TX_Binding_NoServer";
|
||||
public final static String TERMINOLOGY_TX_BINDING_NOSOURCE = "Terminology_TX_Binding_NoSource";
|
||||
public final static String TERMINOLOGY_TX_BINDING_NOSOURCE2 = "Terminology_TX_Binding_NoSource2";
|
||||
public final static String TERMINOLOGY_TX_CODE_NOTVALID = "Terminology_TX_Code_NotValid";
|
||||
public final static String TERMINOLOGY_TX_CODE_UNKNOWN = "Terminology_TX_Code_Unknown";
|
||||
public final static String TERMINOLOGY_TX_CODE_VALUESET = "Terminology_TX_Code_ValueSet";
|
||||
public final static String TERMINOLOGY_TX_CODE_VALUESETMAX = "Terminology_TX_Code_ValueSetMax";
|
||||
public final static String TERMINOLOGY_TX_CODE_VALUESET_EXT = "Terminology_TX_Code_ValueSet_Ext";
|
||||
public final static String TERMINOLOGY_TX_CODING_COUNT = "Terminology_TX_Coding_Count";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_1 = "Terminology_TX_Confirm_1";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_2 = "Terminology_TX_Confirm_2";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_3 = "Terminology_TX_Confirm_3";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_4 = "Terminology_TX_Confirm_4";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_5 = "Terminology_TX_Confirm_5";
|
||||
public final static String TERMINOLOGY_TX_CONFIRM_6 = "Terminology_TX_Confirm_6";
|
||||
public final static String TERMINOLOGY_TX_DISPLAY_WRONG = "Terminology_TX_Display_Wrong";
|
||||
public final static String TERMINOLOGY_TX_ERROR_CODEABLECONCEPT = "Terminology_TX_Error_CodeableConcept";
|
||||
public final static String TERMINOLOGY_TX_ERROR_CODEABLECONCEPT_MAX = "Terminology_TX_Error_CodeableConcept_Max";
|
||||
public final static String TERMINOLOGY_TX_ERROR_CODING1 = "Terminology_TX_Error_Coding1";
|
||||
public final static String TERMINOLOGY_TX_ERROR_CODING2 = "Terminology_TX_Error_Coding2";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_1 = "Terminology_TX_NoValid_1";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_10 = "Terminology_TX_NoValid_10";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_11 = "Terminology_TX_NoValid_11";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_12 = "Terminology_TX_NoValid_12";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_13 = "Terminology_TX_NoValid_13";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_14 = "Terminology_TX_NoValid_14";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_15 = "Terminology_TX_NoValid_15";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_16 = "Terminology_TX_NoValid_16";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_17 = "Terminology_TX_NoValid_17";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_18 = "Terminology_TX_NoValid_18";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_2 = "Terminology_TX_NoValid_2";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_3 = "Terminology_TX_NoValid_3";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_4 = "Terminology_TX_NoValid_4";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_5 = "Terminology_TX_NoValid_5";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_6 = "Terminology_TX_NoValid_6";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_7 = "Terminology_TX_NoValid_7";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_8 = "Terminology_TX_NoValid_8";
|
||||
public final static String TERMINOLOGY_TX_NOVALID_9 = "Terminology_TX_NoValid_9";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_INVALID = "Terminology_TX_System_Invalid";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_NOTKNOWN = "Terminology_TX_System_NotKnown";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_RELATIVE = "Terminology_TX_System_Relative";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_UNKNOWN = "Terminology_TX_System_Unknown";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_VALUESET = "Terminology_TX_System_ValueSet";
|
||||
public final static String TERMINOLOGY_TX_SYSTEM_VALUESET2 = "Terminology_TX_System_ValueSet2";
|
||||
public final static String TERMINOLOGY_TX_VALUESET_NOTFOUND = "Terminology_TX_ValueSet_NotFound";
|
||||
public final static String TERMINOLOGY_TX_VALUESET_NOTFOUND2 = "Terminology_TX_ValueSet_NotFound2";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_BASE64_VALID = "Type_Specific_Checks_DT_Base64_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_BOOLEAN_VALUE = "Type_Specific_Checks_DT_Boolean_Value";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_CODE_WS = "Type_Specific_Checks_DT_Code_WS";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DATETIME_REASONABLE = "Type_Specific_Checks_DT_DateTime_Reasonable";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DATETIME_REGEX = "Type_Specific_Checks_DT_DateTime_Regex";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DATETIME_TZ = "Type_Specific_Checks_DT_DateTime_TZ";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DATETIME_VALID = "Type_Specific_Checks_DT_DateTime_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DATE_VALID = "Type_Specific_Checks_DT_Date_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DECIMAL_RANGE = "Type_Specific_Checks_DT_Decimal_Range";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_DECIMAL_VALID = "Type_Specific_Checks_DT_Decimal_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_IDENTIFIER_SYSTEM = "Type_Specific_Checks_DT_Identifier_System";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_ID_VALID = "Type_Specific_Checks_DT_ID_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INSTANT_VALID = "Type_Specific_Checks_DT_Instant_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER64_VALID = "Type_Specific_Checks_DT_Integer64_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER_GT = "Type_Specific_Checks_DT_Integer_GT";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER_LT = "Type_Specific_Checks_DT_Integer_LT";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER_LT0 = "Type_Specific_Checks_DT_Integer_LT0";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER_LT1 = "Type_Specific_Checks_DT_Integer_LT1";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_INTEGER_VALID = "Type_Specific_Checks_DT_Integer_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_OID_START = "Type_Specific_Checks_DT_OID_Start";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_OID_VALID = "Type_Specific_Checks_DT_OID_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_LENGTH = "Type_Specific_Checks_DT_Primitive_Length";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_NOTEMPTY = "Type_Specific_Checks_DT_Primitive_NotEmpty";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_REGEX = "Type_Specific_Checks_DT_Primitive_Regex";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_VALUEEXT = "Type_Specific_Checks_DT_Primitive_ValueExt";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_WS = "Type_Specific_Checks_DT_Primitive_WS";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_STRING_LENGTH = "Type_Specific_Checks_DT_String_Length";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_STRING_WS = "Type_Specific_Checks_DT_String_WS";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_TIME_VALID = "Type_Specific_Checks_DT_Time_Valid";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_URI_OID = "Type_Specific_Checks_DT_URI_OID";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_URI_UUID = "Type_Specific_Checks_DT_URI_UUID";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_URI_WS = "Type_Specific_Checks_DT_URI_WS";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_URL_RESOLVE = "Type_Specific_Checks_DT_URL_Resolve";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_UUID_STRAT = "Type_Specific_Checks_DT_UUID_Strat";
|
||||
public final static String TYPE_SPECIFIC_CHECKS_DT_UUID_VAID = "Type_Specific_Checks_DT_UUID_Vaid";
|
||||
public final static String VALIDATION_BUNDLE_MESSAGE = "Validation_BUNDLE_Message";
|
||||
public final static String VALIDATION_VAL_CONTENT_UNKNOWN = "Validation_VAL_Content_Unknown";
|
||||
public final static String VALIDATION_VAL_NOTYPE = "Validation_VAL_NoType";
|
||||
public final static String VALIDATION_VAL_PROFILE_MATCHMULTIPLE = "Validation_VAL_Profile_MatchMultiple";
|
||||
public final static String VALIDATION_VAL_PROFILE_MAXIMUM = "Validation_VAL_Profile_Maximum";
|
||||
public final static String VALIDATION_VAL_PROFILE_MINIMUM = "Validation_VAL_Profile_Minimum";
|
||||
public final static String VALIDATION_VAL_PROFILE_MULTIPLEMATCHES = "Validation_VAL_Profile_MultipleMatches";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOCHECKMAX = "Validation_VAL_Profile_NoCheckMax";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOCHECKMIN = "Validation_VAL_Profile_NoCheckMin";
|
||||
public final static String VALIDATION_VAL_PROFILE_NODEFINITION = "Validation_VAL_Profile_NoDefinition";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOMATCH = "Validation_VAL_Profile_NoMatch";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOSNAPSHOT = "Validation_VAL_Profile_NoSnapshot";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOTALLOWED = "Validation_VAL_Profile_NotAllowed";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOTSLICE = "Validation_VAL_Profile_NotSlice";
|
||||
public final static String VALIDATION_VAL_PROFILE_NOTYPE = "Validation_VAL_Profile_NoType";
|
||||
public final static String VALIDATION_VAL_PROFILE_OUTOFORDER = "Validation_VAL_Profile_OutOfOrder";
|
||||
public final static String VALIDATION_VAL_PROFILE_SLICEORDER = "Validation_VAL_Profile_SliceOrder";
|
||||
public final static String VALIDATION_VAL_PROFILE_UNKNOWN = "Validation_VAL_Profile_Unknown";
|
||||
public final static String VALIDATION_VAL_PROFILE_WRONGTYPE = "Validation_VAL_Profile_WrongType";
|
||||
public final static String VALIDATION_VAL_UNKNOWN_PROFILE = "Validation_VAL_Unknown_Profile";
|
||||
public final static String XHTML_XHTML_ATTRIBUTE_ILLEGAL = "XHTML_XHTML_Attribute_Illegal";
|
||||
public final static String XHTML_XHTML_ELEMENT_ILLEGAL = "XHTML_XHTML_Element_Illegal";
|
||||
public final static String XHTML_XHTML_NAME_INVALID = "XHTML_XHTML_Name_Invalid";
|
||||
public final static String XHTML_XHTML_NS_INVALID = "XHTML_XHTML_NS_InValid";
|
||||
public final static String _DT_FIXED_WRONG = "_DT_Fixed_Wrong";
|
||||
public final static String ALL_OBSERVATIONS_SHOULD_HAVE_AN_EFFECTIVEDATETIME_OR_AN_EFFECTIVEPERIOD = "All_observations_should_have_an_effectiveDateTime_or_an_effectivePeriod";
|
||||
public final static String ALL_OBSERVATIONS_SHOULD_HAVE_A_PERFORMER = "All_observations_should_have_a_performer";
|
||||
public final static String ALL_OBSERVATIONS_SHOULD_HAVE_A_SUBJECT = "All_observations_should_have_a_subject";
|
||||
public final static String UNABLE_TO_RESOLVE_SLICE_MATCHING__NO_FIXED_VALUE_OR_REQUIRED_VALUE_SET = "Unable_to_resolve_slice_matching__no_fixed_value_or_required_value_set";
|
||||
public final static String UNABLE_TO_RESOLVE_SLICE_MATCHING__SLICE_MATCHING_BY_VALUE_SET_NOT_DONE = "Unable_to_resolve_slice_matching__slice_matching_by_value_set_not_done";
|
||||
public final static String PROBLEM_PROCESSING_EXPRESSION__IN_PROFILE__PATH__ = "Problem_processing_expression__in_profile__path__";
|
||||
public final static String UNABLE_TO_FIND_ELEMENT_WITH_ID_ = "Unable_to_find_element_with_id_";
|
||||
public final static String SLICE_ENCOUNTERED_MIDWAY_THROUGH_SET_PATH___ID___ = "Slice_encountered_midway_through_set_path___id___";
|
||||
public final static String UNABLE_TO_RESOLVE_ACTUAL_TYPE_ = "Unable_to_resolve_actual_type_";
|
||||
public final static String UNSUPPORTED_VERSION_R1 = "Unsupported_version_R1";
|
||||
public final static String UNSUPPORTED_FIXED_VALUE_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__ = "Unsupported_fixed_value_type_for_discriminator_for_slice__";
|
||||
public final static String UNSUPPORTED_CODEABLECONCEPT_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_ = "Unsupported_CodeableConcept_pattern__extensions_are_not_allowed__for_discriminator_for_slice_";
|
||||
public final static String UNSUPPORTED_CODEABLECONCEPT_PATTERN__MUST_HAVE_AT_LEAST_ONE_CODING__FOR_DISCRIMINATOR_FOR_SLICE_ = "Unsupported_CodeableConcept_pattern__must_have_at_least_one_coding__for_discriminator_for_slice_";
|
||||
public final static String UNSUPPORTED_CODEABLECONCEPT_PATTERN__USING_TEXT__FOR_DISCRIMINATOR_FOR_SLICE_ = "Unsupported_CodeableConcept_pattern__using_text__for_discriminator_for_slice_";
|
||||
public final static String UNSUPPORTED_IDENTIFIER_PATTERN__EXTENSIONS_ARE_NOT_ALLOWED__FOR_DISCRIMINATOR_FOR_SLICE_ = "Unsupported_Identifier_pattern__extensions_are_not_allowed__for_discriminator_for_slice_";
|
||||
public final static String UNSUPPORTED_FIXED_PATTERN_TYPE_FOR_DISCRIMINATOR_FOR_SLICE__ = "Unsupported_fixed_pattern_type_for_discriminator_for_slice__";
|
||||
public final static String PROBLEM_EVALUATING_SLICING_EXPRESSION_FOR_ELEMENT_IN_PROFILE__PATH__FHIRPATH___ = "Problem_evaluating_slicing_expression_for_element_in_profile__path__fhirPath___";
|
||||
public final static String COULD_NOT_MATCH_DISCRIMINATOR__FOR_SLICE__IN_PROFILE___THE_DISCRIMINATOR__DOES_NOT_HAVE_FIXED_VALUE_BINDING_OR_EXISTENCE_ASSERTIONS = "Could_not_match_discriminator__for_slice__in_profile___the_discriminator__does_not_have_fixed_value_binding_or_existence_assertions";
|
||||
public final static String 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__for_slice__in_profile___None_of_the_discriminator__have_fixed_value_binding_or_existence_assertions";
|
||||
public final static String DISCRIMINATOR__IS_BASED_ON_ELEMENT_EXISTENCE_BUT_SLICE__NEITHER_SETS_MIN1_OR_MAX0 = "Discriminator__is_based_on_element_existence_but_slice__neither_sets_min1_or_max0";
|
||||
public final static String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE_WITH_A_PROFILE__IN_PROFILE_ = "Profile_based_discriminators_must_have_a_type_with_a_profile__in_profile_";
|
||||
public final static String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_ONLY_ONE_TYPE__IN_PROFILE_ = "Profile_based_discriminators_must_have_only_one_type__in_profile_";
|
||||
public final static String PROFILE_BASED_DISCRIMINATORS_MUST_HAVE_A_TYPE__IN_PROFILE_ = "Profile_based_discriminators_must_have_a_type__in_profile_";
|
||||
public final static String DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_NO_TYPES = "Discriminator__is_based_on_type_but_slice__in__has_no_types";
|
||||
public final static String DISCRIMINATOR__IS_BASED_ON_TYPE_BUT_SLICE__IN__HAS_MULTIPLE_TYPES_ = "Discriminator__is_based_on_type_but_slice__in__has_multiple_types_";
|
||||
public final static String FOUND__ITEMS_FOR__RESOLVING_DISCRIMINATOR__FROM_ = "Found__items_for__resolving_discriminator__from_";
|
||||
public final static String UNABLE_TO_FIND__RESOLVING_DISCRIMINATOR__FROM_ = "Unable_to_find__resolving_discriminator__from_";
|
||||
public final static String UNABLE_TO_FIND_RESOURCE__AT__RESOLVING_DISCRIMINATOR__FROM_ = "Unable_to_find_resource__at__resolving_discriminator__from_";
|
||||
public final static String NO_REFERENCE_RESOLVING_DISCRIMINATOR__FROM_ = "No_reference_resolving_discriminator__from_";
|
||||
public final static String UNABLE_TO_RESOLVE_ELEMENT__IN_PROFILE_ = "Unable_to_resolve_element__in_profile_";
|
||||
public final static String UNABLE_TO_RESOLVE_PROFILE_ = "Unable_to_resolve_profile_";
|
||||
public final static String RESOURCE_RESOLUTION_SERVICES_NOT_PROVIDED = "Resource_resolution_services_not_provided";
|
||||
public final static String UNRECOGNISED_EXTENSION_CONTEXT_ = "Unrecognised_extension_context_";
|
||||
public final static String UNABLE_TO_LOCATE_THE_PROFILE__IN_ORDER_TO_VALIDATE_AGAINST_IT = "Unable_to_locate_the_profile__in_order_to_validate_against_it";
|
||||
public final static String REFERENCE__REFERS_TO_A__NOT_A_VALUESET = "Reference__refers_to_a__not_a_ValueSet";
|
||||
public final static String NOT_DONE_YET_VALIDATORHOSTSERVICESCONFORMSTOPROFILE_WHEN_ITEM_IS_NOT_AN_ELEMENT = "Not_done_yet_ValidatorHostServicesconformsToProfile_when_item_is_not_an_element";
|
||||
public final static String NOT_SUPPORTED_YET = "Not_supported_yet";
|
||||
public final static String UNABLE_TO_RESOLVE_ = "Unable_to_resolve_";
|
||||
public final static String NOT_DONE_YET__RESOLVE__LOCALLY_2 = "Not_done_yet__resolve__locally_2";
|
||||
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_";
|
||||
|
||||
}
|
|
@ -0,0 +1,267 @@
|
|||
#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
|
||||
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_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_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}
|
|
@ -0,0 +1,267 @@
|
|||
#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
|
||||
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_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_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}
|
|
@ -20,7 +20,7 @@ public class ProfileComparisonTests {
|
|||
public void testCurrentComparison() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Compare US Patient Core with AU Patient Base");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.R4);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2");
|
||||
ve.loadIg("hl7.fhir.us.core#1.0.1", false);
|
||||
ve.loadIg("hl7.fhir.au.base#dev", false);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class ValidationEngineTests {
|
|||
public void testCurrentXml() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate patient-example.xml in Current version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1");
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient-example.xml"), null);
|
||||
int e = errors(op);
|
||||
int w = warnings(op);
|
||||
|
@ -45,7 +45,7 @@ public class ValidationEngineTests {
|
|||
public void testCurrentJson() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate patient-example.json in Current version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, null, FhirPublication.R4, "4.0.1");
|
||||
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "patient-example.json"), null);
|
||||
int e = errors(op);
|
||||
int w = warnings(op);
|
||||
|
@ -65,7 +65,7 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate patient-example.xml in v1.4.0 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, null, FhirPublication.DSTU2016May, "1.4.0");
|
||||
ve.setNoInvariantChecks(true);
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient140.xml"), null);
|
||||
if (!TestUtilities.silent)
|
||||
|
@ -90,7 +90,7 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!org.hl7.fhir.validation.tests.utilities.TestUtilities.silent)
|
||||
System.out.println("Validate patient-example.xml in v1.0.2 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "41.0.2");
|
||||
ve.setNoInvariantChecks(true);
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "patient102.xml"), null);
|
||||
if (!TestUtilities.silent)
|
||||
|
@ -115,7 +115,7 @@ public class ValidationEngineTests {
|
|||
}
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate patient-example.xml in v1.0.2 version");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, null, FhirPublication.DSTU2, "1.0.2");
|
||||
ve.setNoInvariantChecks(true);
|
||||
OperationOutcome op = ve.validate(FhirFormat.JSON, TestingUtilities.loadTestResourceStream("validator", "observation102.json"), null);
|
||||
if (!TestUtilities.silent)
|
||||
|
@ -137,7 +137,7 @@ public class ValidationEngineTests {
|
|||
public void test301() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate observation301.xml against Core");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2");
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println(" .. load USCore");
|
||||
OperationOutcome op = ve.validate(FhirFormat.XML, TestingUtilities.loadTestResourceStream("validator", "observation301.xml"), null);
|
||||
|
@ -156,7 +156,7 @@ public class ValidationEngineTests {
|
|||
public void test301USCore() throws Exception {
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println("Validate patient300.xml against US-Core");
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3);
|
||||
ValidationEngine ve = new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, null, FhirPublication.STU3, "3.0.2");
|
||||
if (!TestUtilities.silent)
|
||||
System.out.println(" .. load USCore");
|
||||
ve.loadIg("hl7.fhir.us.core#1.0.1", false);
|
||||
|
|
|
@ -75,6 +75,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
|
||||
private String name;
|
||||
private JsonObject content;
|
||||
private String version;
|
||||
|
||||
public ValidationTestSuite(String name, JsonObject content) {
|
||||
this.name = name;
|
||||
|
@ -95,33 +96,33 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
if (content.has("txLog")) {
|
||||
txLog = content.get("txLog").getAsString();
|
||||
}
|
||||
String v = "5.0";
|
||||
version = "5.0";
|
||||
List<ValidationMessage> messages = new ArrayList<ValidationMessage>();
|
||||
if (content.has("version")) {
|
||||
v = content.get("version").getAsString();
|
||||
version = content.get("version").getAsString();
|
||||
}
|
||||
|
||||
v = VersionUtilities.getMajMin(v);
|
||||
if (!ve.containsKey(v)) {
|
||||
if (v.startsWith("5.0"))
|
||||
ve.put(v, new ValidationEngine("hl7.fhir.r5.core#current", DEF_TX, txLog, FhirPublication.R5, true));
|
||||
else if (v.startsWith("3.0"))
|
||||
ve.put(v, new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, txLog, FhirPublication.STU3, true));
|
||||
else if (v.startsWith("4.0"))
|
||||
ve.put(v, new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, txLog, FhirPublication.R4, true));
|
||||
else if (v.startsWith("1.0"))
|
||||
ve.put(v, new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, txLog, FhirPublication.DSTU2, true));
|
||||
else if (v.startsWith("1.4"))
|
||||
ve.put(v, new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, txLog, FhirPublication.DSTU2016May, true));
|
||||
version = VersionUtilities.getMajMin(version);
|
||||
if (!ve.containsKey(version)) {
|
||||
if (version.startsWith("5.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r5.core#current", DEF_TX, txLog, FhirPublication.R5, true, "4.2.0"));
|
||||
else if (version.startsWith("3.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r3.core#3.0.2", DEF_TX, txLog, FhirPublication.STU3, true, "3.0.2"));
|
||||
else if (version.startsWith("4.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r4.core#4.0.1", DEF_TX, txLog, FhirPublication.R4, true, "4.0.1"));
|
||||
else if (version.startsWith("1.0"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2.core#1.0.2", DEF_TX, txLog, FhirPublication.DSTU2, true, "1.0.2"));
|
||||
else if (version.startsWith("1.4"))
|
||||
ve.put(version, new ValidationEngine("hl7.fhir.r2b.core#1.4.0", DEF_TX, txLog, FhirPublication.DSTU2016May, true, "1.4.0"));
|
||||
else
|
||||
throw new Exception("unknown version "+v);
|
||||
throw new Exception("unknown version "+version);
|
||||
}
|
||||
vCurr = ve.get(v);
|
||||
vCurr = ve.get(version);
|
||||
vCurr.setFetcher(this);
|
||||
if (TestingUtilities.fcontexts == null) {
|
||||
TestingUtilities.fcontexts = new HashMap<>();
|
||||
}
|
||||
TestingUtilities.fcontexts.put(v, vCurr.getContext());
|
||||
TestingUtilities.fcontexts.put(version, vCurr.getContext());
|
||||
|
||||
if (content.has("use-test") && !content.get("use-test").getAsBoolean())
|
||||
return;
|
||||
|
@ -143,13 +144,13 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
if (content.has("questionnaire")) {
|
||||
String filename = content.get("questionnaire").getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
vCurr.getContext().cacheResource(loadResource(filename, contents, v));
|
||||
vCurr.getContext().cacheResource(loadResource(filename, contents));
|
||||
}
|
||||
if (content.has("codesystems")) {
|
||||
for (JsonElement je : content.getAsJsonArray("codesystems")) {
|
||||
String filename = je.getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
CodeSystem sd = (CodeSystem) loadResource(filename, contents, v);
|
||||
CodeSystem sd = (CodeSystem) loadResource(filename, contents);
|
||||
val.getContext().cacheResource(sd);
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +158,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
for (JsonElement je : content.getAsJsonArray("valuesets")) {
|
||||
String filename = je.getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
ValueSet vs = (ValueSet) loadResource(filename, contents, v);
|
||||
ValueSet vs = (ValueSet) loadResource(filename, contents);
|
||||
val.getContext().cacheResource(vs);
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +166,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
for (JsonElement je : content.getAsJsonArray("profiles")) {
|
||||
String filename = je.getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
StructureDefinition sd = loadProfile(filename, contents, v, messages);
|
||||
StructureDefinition sd = loadProfile(filename, contents, messages);
|
||||
val.getContext().cacheResource(sd);
|
||||
}
|
||||
}
|
||||
|
@ -190,19 +191,22 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
if (content.has("profile")) {
|
||||
System.out.print("** Profile: ");
|
||||
JsonObject profile = content.getAsJsonObject("profile");
|
||||
if (profile.getAsJsonObject("java").has("debug")) {
|
||||
val.setDebug(profile.getAsJsonObject("java").get("debug").getAsBoolean());
|
||||
}
|
||||
if (profile.has("supporting")) {
|
||||
for (JsonElement e : profile.getAsJsonArray("supporting")) {
|
||||
String filename = e.getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents, v);
|
||||
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
|
||||
val.getContext().cacheResource(mr);
|
||||
}
|
||||
}
|
||||
String filename = profile.get("source").getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
System.out.println("Name: " + name+" - profile : "+profile.get("source").getAsString());
|
||||
v = content.has("version") ? content.get("version").getAsString() : Constants.VERSION;
|
||||
StructureDefinition sd = loadProfile(filename, contents, v, messages);
|
||||
version = content.has("version") ? content.get("version").getAsString() : Constants.VERSION;
|
||||
StructureDefinition sd = loadProfile(filename, contents, messages);
|
||||
val.getContext().cacheResource(sd);
|
||||
val.setAssumeValidRestReferences(profile.has("assumeValidRestReferences") ? profile.get("assumeValidRestReferences").getAsBoolean() : false);
|
||||
List<ValidationMessage> errorsProfile = new ArrayList<ValidationMessage>();
|
||||
|
@ -219,7 +223,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
for (JsonElement e : logical.getAsJsonArray("supporting")) {
|
||||
String filename = e.getAsString();
|
||||
String contents = TestingUtilities.loadTestResource("validator", filename);
|
||||
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents, v);
|
||||
CanonicalResource mr = (CanonicalResource) loadResource(filename, contents);
|
||||
if (mr instanceof StructureDefinition) {
|
||||
val.getContext().generateSnapshot((StructureDefinition) mr, true);
|
||||
}
|
||||
|
@ -245,11 +249,11 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
return res;
|
||||
}
|
||||
|
||||
public StructureDefinition loadProfile(String filename, String contents, String v, List<ValidationMessage> messages) throws IOException, FHIRFormatError, FileNotFoundException, FHIRException, DefinitionException {
|
||||
StructureDefinition sd = (StructureDefinition) loadResource(filename, contents, v);
|
||||
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(), messages, null);
|
||||
public StructureDefinition loadProfile(String filename, String contents, List<ValidationMessage> messages) throws IOException, FHIRFormatError, FileNotFoundException, FHIRException, DefinitionException {
|
||||
StructureDefinition sd = (StructureDefinition) loadResource(filename, contents);
|
||||
ProfileUtilities pu = new ProfileUtilities(TestingUtilities.context(version), messages, null);
|
||||
if (!sd.hasSnapshot()) {
|
||||
StructureDefinition base = TestingUtilities.context().fetchResource(StructureDefinition.class, sd.getBaseDefinition());
|
||||
StructureDefinition base = TestingUtilities.context(version).fetchResource(StructureDefinition.class, sd.getBaseDefinition());
|
||||
pu.generateSnapshot(base, sd, sd.getUrl(), null, sd.getTitle());
|
||||
// (debugging) new XmlParser().setOutputStyle(OutputStyle.PRETTY).compose(new FileOutputStream(Utilities.path("[tmp]", sd.getId()+".xml")), sd);
|
||||
}
|
||||
|
@ -257,7 +261,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
if (r instanceof StructureDefinition) {
|
||||
StructureDefinition childSd = (StructureDefinition)r;
|
||||
if (!childSd.hasSnapshot()) {
|
||||
StructureDefinition base = TestingUtilities.context().fetchResource(StructureDefinition.class, childSd.getBaseDefinition());
|
||||
StructureDefinition base = TestingUtilities.context(version).fetchResource(StructureDefinition.class, childSd.getBaseDefinition());
|
||||
pu.generateSnapshot(base, childSd, childSd.getUrl(), null, childSd.getTitle());
|
||||
}
|
||||
}
|
||||
|
@ -265,34 +269,34 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
return sd;
|
||||
}
|
||||
|
||||
public Resource loadResource(String filename, String contents, String v) throws IOException, FHIRFormatError, FileNotFoundException, FHIRException, DefinitionException {
|
||||
public Resource loadResource(String filename, String contents) throws IOException, FHIRFormatError, FileNotFoundException, FHIRException, DefinitionException {
|
||||
try (InputStream inputStream = IOUtils.toInputStream(contents, Charsets.UTF_8)) {
|
||||
if (filename.contains(".json")) {
|
||||
if (Constants.VERSION.equals(v) || "5.0".equals(v))
|
||||
if (Constants.VERSION.equals(version) || "5.0".equals(version))
|
||||
return new JsonParser().parse(inputStream);
|
||||
else if (org.hl7.fhir.dstu3.model.Constants.VERSION.equals(v) || "3.0".equals(v))
|
||||
else if (org.hl7.fhir.dstu3.model.Constants.VERSION.equals(version) || "3.0".equals(version))
|
||||
return VersionConvertor_30_50.convertResource(new org.hl7.fhir.dstu3.formats.JsonParser().parse(inputStream), false);
|
||||
else if (org.hl7.fhir.dstu2016may.model.Constants.VERSION.equals(v) || "1.4".equals(v))
|
||||
else if (org.hl7.fhir.dstu2016may.model.Constants.VERSION.equals(version) || "1.4".equals(version))
|
||||
return VersionConvertor_14_50.convertResource(new org.hl7.fhir.dstu2016may.formats.JsonParser().parse(inputStream));
|
||||
else if (org.hl7.fhir.dstu2.model.Constants.VERSION.equals(v) || "1.0".equals(v))
|
||||
else if (org.hl7.fhir.dstu2.model.Constants.VERSION.equals(version) || "1.0".equals(version))
|
||||
return VersionConvertor_10_50.convertResource(new org.hl7.fhir.dstu2.formats.JsonParser().parse(inputStream));
|
||||
else if (org.hl7.fhir.r4.model.Constants.VERSION.equals(v) || "4.0".equals(v))
|
||||
else if (org.hl7.fhir.r4.model.Constants.VERSION.equals(version) || "4.0".equals(version))
|
||||
return VersionConvertor_40_50.convertResource(new org.hl7.fhir.r4.formats.JsonParser().parse(inputStream));
|
||||
else
|
||||
throw new FHIRException("unknown version "+v);
|
||||
throw new FHIRException("unknown version "+version);
|
||||
} else {
|
||||
if (Constants.VERSION.equals(v) || "5.0".equals(v))
|
||||
if (Constants.VERSION.equals(version) || "5.0".equals(version))
|
||||
return new XmlParser().parse(inputStream);
|
||||
else if (org.hl7.fhir.dstu3.model.Constants.VERSION.equals(v) || "3.0".equals(v))
|
||||
else if (org.hl7.fhir.dstu3.model.Constants.VERSION.equals(version) || "3.0".equals(version))
|
||||
return VersionConvertor_30_50.convertResource(new org.hl7.fhir.dstu3.formats.XmlParser().parse(inputStream), false);
|
||||
else if (org.hl7.fhir.dstu2016may.model.Constants.VERSION.equals(v) || "1.4".equals(v))
|
||||
else if (org.hl7.fhir.dstu2016may.model.Constants.VERSION.equals(version) || "1.4".equals(version))
|
||||
return VersionConvertor_14_50.convertResource(new org.hl7.fhir.dstu2016may.formats.XmlParser().parse(inputStream));
|
||||
else if (org.hl7.fhir.dstu2.model.Constants.VERSION.equals(v) || "1.0".equals(v))
|
||||
else if (org.hl7.fhir.dstu2.model.Constants.VERSION.equals(version) || "1.0".equals(version))
|
||||
return VersionConvertor_10_50.convertResource(new org.hl7.fhir.dstu2.formats.XmlParser().parse(inputStream));
|
||||
else if (org.hl7.fhir.r4.model.Constants.VERSION.equals(v) || "4.0".equals(v))
|
||||
else if (org.hl7.fhir.r4.model.Constants.VERSION.equals(version) || "4.0".equals(version))
|
||||
return VersionConvertor_40_50.convertResource(new org.hl7.fhir.r4.formats.XmlParser().parse(inputStream));
|
||||
else
|
||||
throw new FHIRException("unknown version " + v);
|
||||
throw new FHIRException("unknown version " + version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -320,7 +324,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
}
|
||||
}
|
||||
}
|
||||
if (TestingUtilities.context().isNoTerminologyServer() || !focus.has("tx-dependent")) {
|
||||
if (TestingUtilities.context(version).isNoTerminologyServer() || !focus.has("tx-dependent")) {
|
||||
Assert.assertEquals("Expected "+Integer.toString(java.get("errorCount").getAsInt())+" errors, but found "+Integer.toString(ec)+".", java.get("errorCount").getAsInt(), ec);
|
||||
if (java.has("warningCount"))
|
||||
Assert.assertEquals("Expected "+Integer.toString(java.get("warningCount").getAsInt())+" warnings, but found "+Integer.toString(wc)+".", java.get("warningCount").getAsInt(), wc);
|
||||
|
@ -392,18 +396,18 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
public Element fetch(Object appContext, String url) throws FHIRFormatError, DefinitionException, IOException, FHIRException {
|
||||
Element res = null;
|
||||
if (url.equals("Patient/test")) {
|
||||
res = new ObjectConverter(TestingUtilities.context()).convert(new Patient());
|
||||
res = new ObjectConverter(TestingUtilities.context(version)).convert(new Patient());
|
||||
} else if (TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase()+".json")) {
|
||||
res = Manager.makeParser(TestingUtilities.context(), FhirFormat.JSON).parse(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase()+".json"));
|
||||
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.JSON).parse(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase()+".json"));
|
||||
} else if (TestingUtilities.findTestResource("validator", url.replace("/", "-").toLowerCase()+".xml")) {
|
||||
res = Manager.makeParser(TestingUtilities.context(), FhirFormat.XML).parse(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase()+".xml"));
|
||||
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.XML).parse(TestingUtilities.loadTestResourceStream("validator", url.replace("/", "-").toLowerCase()+".xml"));
|
||||
}
|
||||
if (res == null && url.contains("/")) {
|
||||
String tail = url.substring(url.indexOf("/")+1);
|
||||
if (TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase()+".json")) {
|
||||
res = Manager.makeParser(TestingUtilities.context(), FhirFormat.JSON).parse(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase()+".json"));
|
||||
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.JSON).parse(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase()+".json"));
|
||||
} else if (TestingUtilities.findTestResource("validator", tail.replace("/", "-").toLowerCase()+".xml")) {
|
||||
res = Manager.makeParser(TestingUtilities.context(), FhirFormat.XML).parse(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase()+".xml"));
|
||||
res = Manager.makeParser(TestingUtilities.context(version), FhirFormat.XML).parse(TestingUtilities.loadTestResourceStream("validator", tail.replace("/", "-").toLowerCase()+".xml"));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
@ -424,7 +428,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||
|
||||
@Override
|
||||
public boolean conformsToProfile(Object appContext, Base item, String url) throws FHIRException {
|
||||
IResourceValidator val = TestingUtilities.context().newValidator();
|
||||
IResourceValidator val = TestingUtilities.context(version).newValidator();
|
||||
List<ValidationMessage> valerrors = new ArrayList<ValidationMessage>();
|
||||
if (item instanceof Resource) {
|
||||
val.validate(appContext, valerrors, (Resource) item, url);
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -13,11 +13,11 @@
|
|||
each other. It is fine to bump the point version of this POM without affecting
|
||||
HAPI FHIR.
|
||||
-->
|
||||
<version>4.2.4-SNAPSHOT</version>
|
||||
<version>4.2.6-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<hapi_fhir_version>4.2.0</hapi_fhir_version>
|
||||
<validator_test_case_version>1.0.44-SNAPSHOT</validator_test_case_version>
|
||||
<validator_test_case_version>1.0.46-SNAPSHOT</validator_test_case_version>
|
||||
</properties>
|
||||
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
@echo off
|
||||
|
||||
set oldver=4.2.3
|
||||
set newver=4.2.4
|
||||
set oldver=4.2.5
|
||||
set newver=4.2.6
|
||||
|
||||
echo ..
|
||||
echo =========================================================================
|
||||
|
|
Loading…
Reference in New Issue