Merge branch 'master' into ValueSet-display-names
This commit is contained in:
commit
c9a3d8efc0
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -800,8 +800,12 @@ public abstract class BaseWorkerContext implements IWorkerContext {
|
|||
public Resource fetchResourceById(String type, String uri) {
|
||||
synchronized (lock) {
|
||||
String[] parts = uri.split("\\/");
|
||||
if (!Utilities.noString(type) && parts.length == 1)
|
||||
return allResourcesById.get(type).get(parts[0]);
|
||||
if (!Utilities.noString(type) && parts.length == 1) {
|
||||
if (allResourcesById.containsKey(type))
|
||||
return allResourcesById.get(type).get(parts[0]);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
if (parts.length >= 2) {
|
||||
if (!Utilities.noString(type))
|
||||
if (!type.equals(parts[parts.length-2]))
|
||||
|
|
|
@ -59,4 +59,5 @@ public class Constants {
|
|||
public final static String BUILD_ID = "e0e3caf9ba";
|
||||
public final static String DATE = "Thu Dec 13 14:07:26 AEDT 2018";
|
||||
public final static String URI_REGEX = "((http|https)://([A-Za-z0-9\\\\\\.\\:\\%\\$]*\\/)*)?(Account|ActivityDefinition|AdverseEvent|AllergyIntolerance|Appointment|AppointmentResponse|AuditEvent|Basic|Binary|BiologicallyDerivedProduct|BodyStructure|Bundle|CapabilityStatement|CarePlan|CareTeam|CatalogEntry|ChargeItem|ChargeItemDefinition|Claim|ClaimResponse|ClinicalImpression|CodeSystem|Communication|CommunicationRequest|CompartmentDefinition|Composition|ConceptMap|Condition|Consent|Contract|Coverage|CoverageEligibilityRequest|CoverageEligibilityResponse|DetectedIssue|Device|DeviceDefinition|DeviceMetric|DeviceRequest|DeviceUseStatement|DiagnosticReport|DocumentManifest|DocumentReference|EffectEvidenceSynthesis|Encounter|Endpoint|EnrollmentRequest|EnrollmentResponse|EpisodeOfCare|EventDefinition|Evidence|EvidenceVariable|ExampleScenario|ExplanationOfBenefit|FamilyMemberHistory|Flag|Goal|GraphDefinition|Group|GuidanceResponse|HealthcareService|ImagingStudy|Immunization|ImmunizationEvaluation|ImmunizationRecommendation|ImplementationGuide|InsurancePlan|Invoice|Library|Linkage|List|Location|Measure|MeasureReport|Media|Medication|MedicationAdministration|MedicationDispense|MedicationKnowledge|MedicationRequest|MedicationStatement|MedicinalProduct|MedicinalProductAuthorization|MedicinalProductContraindication|MedicinalProductIndication|MedicinalProductIngredient|MedicinalProductInteraction|MedicinalProductManufactured|MedicinalProductPackaged|MedicinalProductPharmaceutical|MedicinalProductUndesirableEffect|MessageDefinition|MessageHeader|MolecularSequence|NamingSystem|NutritionOrder|Observation|ObservationDefinition|OperationDefinition|OperationOutcome|Organization|OrganizationAffiliation|Patient|PaymentNotice|PaymentReconciliation|Person|PlanDefinition|Practitioner|PractitionerRole|Procedure|Provenance|Questionnaire|QuestionnaireResponse|RelatedPerson|RequestGroup|ResearchDefinition|ResearchElementDefinition|ResearchStudy|ResearchSubject|RiskAssessment|RiskEvidenceSynthesis|Schedule|SearchParameter|ServiceRequest|Slot|Specimen|SpecimenDefinition|StructureDefinition|StructureMap|Subscription|Substance|SubstanceNucleicAcid|SubstancePolymer|SubstanceProtein|SubstanceReferenceInformation|SubstanceSourceMaterial|SubstanceSpecification|SupplyDelivery|SupplyRequest|Task|TerminologyCapabilities|TestReport|TestScript|ValueSet|VerificationResult|VisionPrescription)\\/[A-Za-z0-9\\-\\.]{1,64}(\\/_history\\/[A-Za-z0-9\\-\\.]{1,64})?";
|
||||
public final static String LOCAL_REF_REGEX = "(Account|ActivityDefinition|AdverseEvent|AllergyIntolerance|Appointment|AppointmentResponse|AuditEvent|Basic|Binary|BiologicallyDerivedProduct|BodyStructure|Bundle|CapabilityStatement|CarePlan|CareTeam|CatalogEntry|ChargeItem|ChargeItemDefinition|Claim|ClaimResponse|ClinicalImpression|CodeSystem|Communication|CommunicationRequest|CompartmentDefinition|Composition|ConceptMap|Condition|Consent|Contract|Coverage|CoverageEligibilityRequest|CoverageEligibilityResponse|DetectedIssue|Device|DeviceDefinition|DeviceMetric|DeviceRequest|DeviceUseStatement|DiagnosticReport|DocumentManifest|DocumentReference|EffectEvidenceSynthesis|Encounter|Endpoint|EnrollmentRequest|EnrollmentResponse|EpisodeOfCare|EventDefinition|Evidence|EvidenceVariable|ExampleScenario|ExplanationOfBenefit|FamilyMemberHistory|Flag|Goal|GraphDefinition|Group|GuidanceResponse|HealthcareService|ImagingStudy|Immunization|ImmunizationEvaluation|ImmunizationRecommendation|ImplementationGuide|InsurancePlan|Invoice|Library|Linkage|List|Location|Measure|MeasureReport|Media|Medication|MedicationAdministration|MedicationDispense|MedicationKnowledge|MedicationRequest|MedicationStatement|MedicinalProduct|MedicinalProductAuthorization|MedicinalProductContraindication|MedicinalProductIndication|MedicinalProductIngredient|MedicinalProductInteraction|MedicinalProductManufactured|MedicinalProductPackaged|MedicinalProductPharmaceutical|MedicinalProductUndesirableEffect|MessageDefinition|MessageHeader|MolecularSequence|NamingSystem|NutritionOrder|Observation|ObservationDefinition|OperationDefinition|OperationOutcome|Organization|OrganizationAffiliation|Patient|PaymentNotice|PaymentReconciliation|Person|PlanDefinition|Practitioner|PractitionerRole|Procedure|Provenance|Questionnaire|QuestionnaireResponse|RelatedPerson|RequestGroup|ResearchDefinition|ResearchElementDefinition|ResearchStudy|ResearchSubject|RiskAssessment|RiskEvidenceSynthesis|Schedule|SearchParameter|ServiceRequest|Slot|Specimen|SpecimenDefinition|StructureDefinition|StructureMap|Subscription|Substance|SubstanceNucleicAcid|SubstancePolymer|SubstanceProtein|SubstanceReferenceInformation|SubstanceSourceMaterial|SubstanceSpecification|SupplyDelivery|SupplyRequest|Task|TerminologyCapabilities|TestReport|TestScript|ValueSet|VerificationResult|VisionPrescription)\\/[A-Za-z0-9\\-\\.]{1,64}";
|
||||
}
|
||||
|
|
|
@ -447,47 +447,59 @@ Modifier extensions SHALL NOT change the meaning of any elements on Resource or
|
|||
|
||||
// added from java-adornments.txt:
|
||||
|
||||
public void checkNoModifiers(String noun, String verb) throws FHIRException {
|
||||
public void checkNoModifiers(String noun, String verb) throws FHIRException {
|
||||
if (hasModifierExtension()) {
|
||||
throw new FHIRException("Found unknown Modifier Exceptions on "+noun+" doing "+verb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void addExtension(String url, Type value) {
|
||||
Extension ex = new Extension();
|
||||
ex.setUrl(url);
|
||||
ex.setValue(value);
|
||||
getExtension().add(ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean hasExtension(String url) {
|
||||
for (Extension e : getExtension())
|
||||
if (url.equals(e.getUrl()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public Extension getExtensionByUrl(String theUrl) {
|
||||
org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null");
|
||||
ArrayList<Extension> retVal = new ArrayList<Extension>();
|
||||
for (Extension next : getExtension()) {
|
||||
if (theUrl.equals(next.getUrl())) {
|
||||
retVal.add(next);
|
||||
}
|
||||
}
|
||||
if (retVal.size() == 0)
|
||||
return null;
|
||||
else {
|
||||
org.apache.commons.lang3.Validate.isTrue(retVal.size() == 1, "Url "+theUrl+" must have only one match");
|
||||
return retVal.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Resource getContained(String ref) {
|
||||
if (ref == null)
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public void addExtension(String url, Type value) {
|
||||
Extension ex = new Extension();
|
||||
ex.setUrl(url);
|
||||
ex.setValue(value);
|
||||
getExtension().add(ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean hasExtension(String url) {
|
||||
for (Extension e : getExtension())
|
||||
if (url.equals(e.getUrl()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public Extension getExtensionByUrl(String theUrl) {
|
||||
org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null");
|
||||
ArrayList<Extension> retVal = new ArrayList<Extension>();
|
||||
for (Extension next : getExtension()) {
|
||||
if (theUrl.equals(next.getUrl())) {
|
||||
retVal.add(next);
|
||||
}
|
||||
}
|
||||
if (retVal.size() == 0)
|
||||
return null;
|
||||
else {
|
||||
org.apache.commons.lang3.Validate.isTrue(retVal.size() == 1, "Url "+theUrl+" must have only one match");
|
||||
return retVal.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ref.startsWith("#"))
|
||||
ref = ref.substring(1);
|
||||
for (Resource r : getContained()) {
|
||||
if (r.getId().equals(ref))
|
||||
return r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// end addition
|
||||
|
||||
|
|
|
@ -3885,6 +3885,5 @@ public class StructureDefinition extends MetadataResource {
|
|||
*/
|
||||
public static final ca.uhn.fhir.model.api.Include INCLUDE_BASE = new ca.uhn.fhir.model.api.Include("StructureDefinition:base").toLocked();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3369,7 +3369,7 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
return "??Lang";
|
||||
}
|
||||
|
||||
private boolean addDefineRowToTable(XhtmlNode t, ConceptDefinitionComponent c, int i, boolean hasHierarchy, boolean hasDisplay, boolean comment, boolean version, boolean deprecated, List<UsedConceptMap> maps, String system, CodeSystem cs, String lang) {
|
||||
private boolean addDefineRowToTable(XhtmlNode t, ConceptDefinitionComponent c, int i, boolean hasHierarchy, boolean hasDisplay, boolean comment, boolean version, boolean deprecated, List<UsedConceptMap> maps, String system, CodeSystem cs, String lang) throws FHIRFormatError, DefinitionException, IOException {
|
||||
boolean hasExtensions = false;
|
||||
XhtmlNode tr = t.tr();
|
||||
XhtmlNode td = tr.td();
|
||||
|
@ -3417,7 +3417,10 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
if (c != null &&
|
||||
c.hasDefinitionElement()) {
|
||||
if (lang == null) {
|
||||
td.addText(c.getDefinition());
|
||||
if (hasMarkdownInDefinitions(cs))
|
||||
addMarkdown(td, c.getDefinition());
|
||||
else
|
||||
td.addText(c.getDefinition());
|
||||
} else if (lang.equals("*")) {
|
||||
boolean sl = false;
|
||||
for (ConceptDefinitionDesignationComponent cd : c.getDesignation())
|
||||
|
@ -3534,6 +3537,10 @@ public class NarrativeGenerator implements INarrativeGenerator {
|
|||
}
|
||||
|
||||
|
||||
private boolean hasMarkdownInDefinitions(CodeSystem cs) {
|
||||
return ToolingExtensions.readBoolExtension(cs, "http://hl7.org/fhir/StructureDefinition/codesystem-use-markdown");
|
||||
}
|
||||
|
||||
private String makeAnchor(String codeSystem, String code) {
|
||||
String s = codeSystem+'-'+code;
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>org.hl7.fhir.core</artifactId>
|
||||
<version>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-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>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -2759,12 +2759,12 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
vs = null;
|
||||
}
|
||||
if (vs != null) {
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.hasCompose() && !vs.hasExpansion(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but it is an expansion"))
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.getCompose().getInclude().size() == 1, "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a single include"))
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.getCompose().getInclude().get(0).getSystem().equals(url), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a matching system ("+vs.getCompose().getInclude().get(0).getSystem()+")")) {
|
||||
rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), !vs.getCompose().getInclude().get(0).hasValueSet()
|
||||
&& !vs.getCompose().getInclude().get(0).hasConcept() && !vs.getCompose().getInclude().get(0).hasFilter(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but the include has extra details");
|
||||
}
|
||||
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.hasCompose() && !vs.hasExpansion(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", and contains an expansion");
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.getCompose().getInclude().size() == 0, "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have an include"))
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), vs.getCompose().getInclude().get(0).getSystem().equals(url), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but doesn't have a matching system ("+vs.getCompose().getInclude().get(0).getSystem()+")")) {
|
||||
if (rule(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), !vs.getCompose().getInclude().get(0).hasValueSet() && !vs.getCompose().getInclude().get(0).hasConcept(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but the include has extra details"))
|
||||
warning(errors, IssueType.BUSINESSRULE, stack.getLiteralPath(), !vs.getCompose().getInclude().get(0).hasFilter(), "CodeSystem "+url+" has a 'all system' value set of "+vsu+", but the include involves filters");
|
||||
}
|
||||
}
|
||||
} // todo... try getting the value set the other way...
|
||||
}
|
||||
|
|
|
@ -392,11 +392,11 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
if (!ok)
|
||||
errors.add(new ValidationMessage(Source.InstanceValidator, IssueType.UNKNOWN, path, "Profile mismatch on type for "+profile.getProfile()+": the profile constrains "+sd.getType()+" but the element is "+element.fhirType(), IssueSeverity.ERROR));
|
||||
} else
|
||||
addProfile(errors, profile.getProfile(), profile.isError(), path, element);
|
||||
addProfile(errors, profile.getProfile(), profile.isError(), path, element, sd);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean addProfile(List<ValidationMessage> errors, String profile, boolean error, String path, Element element) {
|
||||
public boolean addProfile(List<ValidationMessage> errors, String profile, boolean error, String path, Element element, StructureDefinition containingProfile) {
|
||||
String effectiveProfile = profile;
|
||||
String version = null;
|
||||
if (profile.contains("|")) {
|
||||
|
@ -404,10 +404,22 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
version = profile.substring(profile.indexOf('|')+1);
|
||||
}
|
||||
StructureDefinition sd = null;
|
||||
if (providedProfiles != null)
|
||||
sd = providedProfiles.fetch(effectiveProfile);
|
||||
if (sd == null)
|
||||
sd = context.fetchResource(StructureDefinition.class, effectiveProfile);
|
||||
if (profile.startsWith("#")) {
|
||||
if (!rule(errors, IssueType.INVALID, element.line(), element.col(), path, sd != null, "StructureDefinition reference \"{0}\" is local, but there is not local context", profile)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (containingProfile.hasUserData("container"))
|
||||
containingProfile = (StructureDefinition) containingProfile.getUserData("container");
|
||||
sd = (StructureDefinition) containingProfile.getContained(profile);
|
||||
if (sd != null)
|
||||
sd.setUserData("container", containingProfile);
|
||||
} else {
|
||||
if (providedProfiles != null)
|
||||
sd = providedProfiles.fetch(effectiveProfile);
|
||||
if (sd == null)
|
||||
sd = context.fetchResource(StructureDefinition.class, effectiveProfile);
|
||||
}
|
||||
|
||||
if (warningOrError(error, errors, IssueType.INVALID, element.line(), element.col(), path, sd != null, "StructureDefinition reference \"{0}\" could not be resolved", profile)) {
|
||||
if (rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, version==null || (sd.getVersion()!=null && sd.getVersion().equals(version)),
|
||||
|
@ -1180,7 +1192,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
String p = stack.addToLiteralPath("meta", "profile", ":" + Integer.toString(i));
|
||||
if (rule(errors, IssueType.INVALID, element.line(), element.col(), p, !Utilities.noString(ref), "StructureDefinition reference invalid")) {
|
||||
long t = System.nanoTime();
|
||||
resourceProfiles.addProfile(errors, ref, errorForUnknownProfiles, p, element);
|
||||
resourceProfiles.addProfile(errors, ref, errorForUnknownProfiles, p, element, null);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
@ -1859,7 +1871,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
b.append(bt);
|
||||
ok = bt.equals(ft);
|
||||
if (ok && we!=null && pol.checkValid()) {
|
||||
doResourceProfile(hostContext, we, pr, errors, stack.push(we, -1, null, null), path, element);
|
||||
doResourceProfile(hostContext, we, pr, errors, stack.push(we, -1, null, null), path, element, profile);
|
||||
}
|
||||
} else
|
||||
ok = true; // suppress following check
|
||||
|
@ -1909,8 +1921,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
}
|
||||
}
|
||||
|
||||
private void doResourceProfile(ValidatorHostContext hostContext, Element resource, String profile, List<ValidationMessage> errors, NodeStack stack, String path, Element element) throws FHIRException, IOException {
|
||||
ResourceProfiles resourceProfiles = addResourceProfile(errors, resource, profile, path, element, stack);
|
||||
private void doResourceProfile(ValidatorHostContext hostContext, Element resource, String profile, List<ValidationMessage> errors, NodeStack stack, String path, Element element, StructureDefinition containingProfile) throws FHIRException, IOException {
|
||||
ResourceProfiles resourceProfiles = addResourceProfile(errors, resource, profile, path, element, stack, containingProfile);
|
||||
if (resourceProfiles.isProcessed()) {
|
||||
start(hostContext, errors, resource, resource, null, stack);
|
||||
}
|
||||
|
@ -1925,9 +1937,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
|||
return resourceProfiles;
|
||||
}
|
||||
|
||||
private ResourceProfiles addResourceProfile(List<ValidationMessage> errors, Element resource, String profile, String path, Element element, NodeStack stack) {
|
||||
private ResourceProfiles addResourceProfile(List<ValidationMessage> errors, Element resource, String profile, String path, Element element, NodeStack stack, StructureDefinition containingProfile) {
|
||||
ResourceProfiles resourceProfiles = getResourceProfiles(resource, stack);
|
||||
resourceProfiles.addProfile(errors, profile, errorForUnknownProfiles, path, element);
|
||||
resourceProfiles.addProfile(errors, profile, errorForUnknownProfiles, path, element, containingProfile);
|
||||
return resourceProfiles;
|
||||
}
|
||||
|
||||
|
|
|
@ -561,14 +561,21 @@
|
|||
"errorCount": 16
|
||||
}
|
||||
},
|
||||
"patient-translated-codes.xml" : {
|
||||
"patient-translated-codes.xml" : {
|
||||
"errorCount": 0,
|
||||
"warningCount": 4,
|
||||
"profile" : {
|
||||
"source" : "patient-translated-codes.profile.xml",
|
||||
"errorCount": 0,
|
||||
"warningCount": 0
|
||||
}
|
||||
},
|
||||
"patient-contained-org.xml" : {
|
||||
"errorCount": 0,
|
||||
"profile" : {
|
||||
"source" : "patient-contained-org-profile.xml",
|
||||
"errorCount": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<StructureDefinition xmlns="http://hl7.org/fhir">
|
||||
<id value="patient-contained-org-profile"/>
|
||||
<contained>
|
||||
<StructureDefinition>
|
||||
<id value="gp"/>
|
||||
<url value="http://hl7.org/fhir/patient-contained-org-org-profile"/>
|
||||
<name value="PatientContainedOrgOrg"/>
|
||||
<status value="draft"/>
|
||||
<kind value="resource"/>
|
||||
<abstract value="false"/>
|
||||
<type value="Organization"/>
|
||||
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Organization"/>
|
||||
<derivation value="constraint"/>
|
||||
<differential>
|
||||
<element id="Organization">
|
||||
<path value="Organization"/>
|
||||
</element>
|
||||
<element id="Organization.name">
|
||||
<path value="Organization.name"/>
|
||||
<min value="1"/>
|
||||
</element>
|
||||
</differential>
|
||||
</StructureDefinition>
|
||||
</contained>
|
||||
<url value="http://hl7.org/fhir/StructureDefinition/patient-contained-gp-profile"/>
|
||||
<name value="PatientContainedOrgProfile"/>
|
||||
<status value="draft"/>
|
||||
<description value="Test profile to confirm that targetProfiles on references are enforced against contained resources"/>
|
||||
<kind value="resource"/>
|
||||
<abstract value="false"/>
|
||||
<type value="Patient"/>
|
||||
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient"/>
|
||||
<derivation value="constraint"/>
|
||||
<differential>
|
||||
<element id="Patient">
|
||||
<path value="Patient"/>
|
||||
</element>
|
||||
<element id="Patient.generalPractitioner">
|
||||
<path value="Patient.generalPractitioner"/>
|
||||
<type>
|
||||
<code value="Reference"/>
|
||||
<targetProfile value="#gp"/>
|
||||
<aggregation value="contained"/>
|
||||
</type>
|
||||
</element>
|
||||
</differential>
|
||||
</StructureDefinition>
|
|
@ -0,0 +1,20 @@
|
|||
<Patient xmlns="http://hl7.org/fhir">
|
||||
<id value="patient-error-gender"/>
|
||||
<text>
|
||||
<status value="generated"/>
|
||||
<div xmlns="http://www.w3.org/1999/xhtml">
|
||||
Check that profile validation checks contained resources - should fail because Organization is missing 'name' which is required by profile
|
||||
</div>
|
||||
</text>
|
||||
<contained>
|
||||
<Organization>
|
||||
<id value="gp"/>
|
||||
<identifier>
|
||||
<value value="123"/>
|
||||
</identifier>
|
||||
</Organization>
|
||||
</contained>
|
||||
<generalPractitioner>
|
||||
<reference value="#gp"/>
|
||||
</generalPractitioner>
|
||||
</Patient>
|
2
pom.xml
2
pom.xml
|
@ -13,7 +13,7 @@
|
|||
each other. It is fine to bump the point version of this POM without affecting
|
||||
HAPI FHIR.
|
||||
-->
|
||||
<version>3.7.37-SNAPSHOT</version>
|
||||
<version>3.7.38-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<hapi_fhir_version>3.7.0-SNAPSHOT</hapi_fhir_version>
|
||||
|
|
16
release.bat
16
release.bat
|
@ -4,25 +4,25 @@ REM make sure you are committed
|
|||
@echo off
|
||||
echo ..
|
||||
echo =====================================================================
|
||||
echo upgrade and release fhir.core from 3.7.36-SNAPSHOT to 3.7.37-SNAPSHOT
|
||||
echo upgrade and release fhir.core from 3.7.37-SNAPSHOT to 3.7.38-SNAPSHOT
|
||||
echo =====================================================================
|
||||
echo ..
|
||||
echo check versions and make sure committed...
|
||||
pause
|
||||
|
||||
call mvn versions:set -DnewVersion=3.7.37-SNAPSHOT
|
||||
call mvn versions:set -DnewVersion=3.7.38-SNAPSHOT
|
||||
call git commit -a -m "Release new version"
|
||||
call git push origin master
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --includeSubDirectories --find "3.7.36-SNAPSHOT" --replace "3.7.37-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\fhir-ig-publisher" --fileMask "*.xml" --includeSubDirectories --find "3.7.36-SNAPSHOT" --replace "3.7.37-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --find "3.7.36-SNAPSHOT" --replace "3.7.37-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.java" --includeSubDirectories --find "3.7.37-SNAPSHOT" --replace "3.7.38-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\fhir-ig-publisher" --fileMask "*.xml" --includeSubDirectories --find "3.7.37-SNAPSHOT" --replace "3.7.38-SNAPSHOT"
|
||||
call "C:\tools\fnr.exe" --cl --dir "C:\work\org.hl7.fhir\build" --fileMask "*.xml" --find "3.7.37-SNAPSHOT" --replace "3.7.38-SNAPSHOT"
|
||||
call mvn deploy
|
||||
copy org.hl7.fhir.validation.cli\target\org.hl7.fhir.validation.cli-3.7.37-SNAPSHOT.jar ..\latest-ig-publisher\org.hl7.fhir.validator.jar
|
||||
copy org.hl7.fhir.validation.cli\target\org.hl7.fhir.validation.cli-3.7.38-SNAPSHOT.jar ..\latest-ig-publisher\org.hl7.fhir.validator.jar
|
||||
cd ..\latest-ig-publisher
|
||||
call git commit -a -m "Release new version 3.7.37-SNAPSHOT"
|
||||
call git commit -a -m "Release new version 3.7.38-SNAPSHOT"
|
||||
call git push origin master
|
||||
cd ..\org.hl7.fhir.core
|
||||
call python c:\tools\zulip-api\zulip\zulip\send.py --stream committers/notification --subject "java core" -m "New Java Core v3.7.37-SNAPSHOT released. New Validator at https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=ca.uhn.hapi.fhir&a=org.hl7.fhir.validation.cli&v=3.7.37-SNAPSHOT&e=jar, and also deployed at https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.validator.jar" --config-file zuliprc
|
||||
call python c:\tools\zulip-api\zulip\zulip\send.py --stream committers/notification --subject "java core" -m "New Java Core v3.7.38-SNAPSHOT released. New Validator at https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=ca.uhn.hapi.fhir&a=org.hl7.fhir.validation.cli&v=3.7.38-SNAPSHOT&e=jar, and also deployed at https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.validator.jar" --config-file zuliprc
|
||||
|
||||
echo ===============================================================
|
||||
echo all done
|
||||
|
|
Loading…
Reference in New Issue