Fix build and sync RI
This commit is contained in:
parent
56a4c1b04b
commit
f2bf199ac7
|
@ -41,6 +41,16 @@ public class RuntimeChildContainedResources extends BaseRuntimeDeclaredChildDefi
|
|||
super(theField, theChildAnnotation, theDescriptionAnnotation, theElementName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMax() {
|
||||
return Child.MAX_UNLIMITED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMin() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
|
||||
assert theName.equals(getElementName());
|
||||
|
|
|
@ -76,8 +76,13 @@ public class FhirResourceDaoQuestionnaireAnswersDstu2 extends FhirResourceDaoDst
|
|||
*/
|
||||
if ("ValueSet".equals(theType.getSimpleName())) {
|
||||
IFhirResourceDao<ValueSet> dao = getDao(ValueSet.class);
|
||||
ValueSet vs = dao.read(theId);
|
||||
return myRefImplCtx.newJsonParser().parseResource(theType, getContext().newJsonParser().encodeResourceToString(vs));
|
||||
ValueSet in = dao.read(theId);
|
||||
String encoded = getContext().newJsonParser().encodeResourceToString(in);
|
||||
|
||||
// TODO: this is temporary until structures-dstu2 catches up to structures-hl7org.dstu2
|
||||
encoded = encoded.replace("\"define\"", "\"codeSystem\"");
|
||||
|
||||
return myRefImplCtx.newJsonParser().parseResource(theType, encoded);
|
||||
} else if ("Questionnaire".equals(theType.getSimpleName())) {
|
||||
IFhirResourceDao<Questionnaire> dao = getDao(Questionnaire.class);
|
||||
Questionnaire vs = dao.read(theId);
|
||||
|
|
|
@ -1,131 +0,0 @@
|
|||
/target/
|
||||
/.settings/
|
||||
.classpath
|
||||
.project
|
||||
/target/
|
||||
|
||||
# Created by https://www.gitignore.io
|
||||
|
||||
### Java ###
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
|
||||
|
||||
### Vim ###
|
||||
[._]*.s[a-w][a-z]
|
||||
[._]s[a-w][a-z]
|
||||
*.un~
|
||||
Session.vim
|
||||
.netrwhist
|
||||
*~
|
||||
|
||||
|
||||
### Intellij ###
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
|
||||
|
||||
*.iml
|
||||
|
||||
## Directory-based project format:
|
||||
.idea/
|
||||
# if you remove the above rule, at least ignore the following:
|
||||
|
||||
# User-specific stuff:
|
||||
# .idea/workspace.xml
|
||||
# .idea/tasks.xml
|
||||
# .idea/dictionaries
|
||||
|
||||
# Sensitive or high-churn files:
|
||||
# .idea/dataSources.ids
|
||||
# .idea/dataSources.xml
|
||||
# .idea/sqlDataSources.xml
|
||||
# .idea/dynamic.xml
|
||||
# .idea/uiDesigner.xml
|
||||
|
||||
# Gradle:
|
||||
# .idea/gradle.xml
|
||||
# .idea/libraries
|
||||
|
||||
# Mongo Explorer plugin:
|
||||
# .idea/mongoSettings.xml
|
||||
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
## Plugin-specific files:
|
||||
|
||||
# IntelliJ
|
||||
/out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
|
||||
|
||||
|
||||
### Eclipse ###
|
||||
*.pydevproject
|
||||
.metadata
|
||||
.gradle
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# Eclipse Core
|
||||
.project
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
|
@ -1,356 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-deployable-pom</artifactId>
|
||||
<version>0.9</version>
|
||||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>hapi-fhir-structures-dev</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>HAPI FHIR Structures - DEV (FHIR Latest)</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-base</artifactId>
|
||||
<version>0.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${servlet_api_version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Testing -->
|
||||
<!-- <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-structures-dstu</artifactId>
|
||||
<version>0.8</version> <scope>test</scope> </dependency> -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xmlunit</groupId>
|
||||
<artifactId>xmlunit</artifactId>
|
||||
<version>1.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>${jetty_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>${logback_version}</version>
|
||||
<optional>true</optional>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ebaysf.web</groupId>
|
||||
<artifactId>cors-filter</artifactId>
|
||||
<version>${ebay_cors_filter_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
<version>${thymeleaf-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.phloc</groupId>
|
||||
<artifactId>phloc-schematron</artifactId>
|
||||
<version>${phloc_schematron_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.phloc</groupId>
|
||||
<artifactId>phloc-commons</artifactId>
|
||||
<version>${phloc_commons_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- UNIT TEST DEPENDENCIES -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-all</artifactId>
|
||||
<version>1.9.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15</classifier>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15-sources</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>directory-naming</groupId>
|
||||
<artifactId>naming-java</artifactId>
|
||||
<version>0.8</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>java-hamcrest</artifactId>
|
||||
<version>${hamcrest_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>${guava_version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId>
|
||||
<version>${spring_security_version}</version> <scope>test</scope> </dependency>
|
||||
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
|
||||
<version>${spring_security_version}</version> <scope>test</scope> </dependency>
|
||||
<dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-jwt</artifactId>
|
||||
<version>1.0.2.RELEASE</version> <scope>test</scope> </dependency> -->
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-tinder-plugin</artifactId>
|
||||
<version>0.9</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate-structures</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<package>ca.uhn.fhir.model.dev</package>
|
||||
<version>dev</version>
|
||||
<baseResourceNames>
|
||||
<baseResourceName>Condition</baseResourceName>
|
||||
<baseResourceName>Supply</baseResourceName>
|
||||
<baseResourceName>DeviceComponent</baseResourceName>
|
||||
<baseResourceName>Communication</baseResourceName>
|
||||
<baseResourceName>Group</baseResourceName>
|
||||
<baseResourceName>ValueSet</baseResourceName>
|
||||
<baseResourceName>OralHealthClaim</baseResourceName>
|
||||
<baseResourceName>Coverage</baseResourceName>
|
||||
<baseResourceName>Appointment</baseResourceName>
|
||||
<baseResourceName>Slot</baseResourceName>
|
||||
<baseResourceName>Contraindication</baseResourceName>
|
||||
<baseResourceName>Composition</baseResourceName>
|
||||
<baseResourceName>EpisodeOfCare</baseResourceName>
|
||||
<baseResourceName>Conformance</baseResourceName>
|
||||
<baseResourceName>NamingSystem</baseResourceName>
|
||||
<baseResourceName>HealthcareService</baseResourceName>
|
||||
<baseResourceName>OrderResponse</baseResourceName>
|
||||
<baseResourceName>StatusResponse</baseResourceName>
|
||||
<baseResourceName>ConceptMap</baseResourceName>
|
||||
<baseResourceName>PharmacyClaim</baseResourceName>
|
||||
<baseResourceName>Reversal</baseResourceName>
|
||||
<baseResourceName>Practitioner</baseResourceName>
|
||||
<baseResourceName>CarePlan</baseResourceName>
|
||||
<baseResourceName>ClinicalAssessment</baseResourceName>
|
||||
<baseResourceName>Substance</baseResourceName>
|
||||
<baseResourceName>DeviceUseRequest</baseResourceName>
|
||||
<baseResourceName>Schedule</baseResourceName>
|
||||
<baseResourceName>EligibilityRequest</baseResourceName>
|
||||
<baseResourceName>QuestionnaireAnswers</baseResourceName>
|
||||
<baseResourceName>PaymentReconciliation</baseResourceName>
|
||||
<baseResourceName>ProfessionalClaim</baseResourceName>
|
||||
<baseResourceName>ImagingObjectSelection</baseResourceName>
|
||||
<baseResourceName>OperationDefinition</baseResourceName>
|
||||
<baseResourceName>ClaimResponse</baseResourceName>
|
||||
<baseResourceName>BodySite</baseResourceName>
|
||||
<baseResourceName>CommunicationRequest</baseResourceName>
|
||||
<baseResourceName>RiskAssessment</baseResourceName>
|
||||
<baseResourceName>Observation</baseResourceName>
|
||||
<baseResourceName>AllergyIntolerance</baseResourceName>
|
||||
<baseResourceName>ExplanationOfBenefit</baseResourceName>
|
||||
<baseResourceName>SupportingDocumentation</baseResourceName>
|
||||
<baseResourceName>RelatedPerson</baseResourceName>
|
||||
<baseResourceName>InstitutionalClaim</baseResourceName>
|
||||
<baseResourceName>Alert</baseResourceName>
|
||||
<baseResourceName>AuditEvent</baseResourceName>
|
||||
<baseResourceName>EligibilityResponse</baseResourceName>
|
||||
<baseResourceName>StatusRequest</baseResourceName>
|
||||
<baseResourceName>Person</baseResourceName>
|
||||
<baseResourceName>ProcedureRequest</baseResourceName>
|
||||
<baseResourceName>VisionClaim</baseResourceName>
|
||||
<baseResourceName>DeviceMetric</baseResourceName>
|
||||
<baseResourceName>Organization</baseResourceName>
|
||||
<baseResourceName>Readjudicate</baseResourceName>
|
||||
<baseResourceName>ImmunizationRecommendation</baseResourceName>
|
||||
<baseResourceName>MedicationDispense</baseResourceName>
|
||||
<baseResourceName>MedicationPrescription</baseResourceName>
|
||||
<baseResourceName>PaymentNotice</baseResourceName>
|
||||
<baseResourceName>MedicationStatement</baseResourceName>
|
||||
<baseResourceName>AppointmentResponse</baseResourceName>
|
||||
<baseResourceName>Questionnaire</baseResourceName>
|
||||
<baseResourceName>OperationOutcome</baseResourceName>
|
||||
<baseResourceName>Media</baseResourceName>
|
||||
<baseResourceName>Other</baseResourceName>
|
||||
<baseResourceName>VisionPrescription</baseResourceName>
|
||||
<baseResourceName>DocumentReference</baseResourceName>
|
||||
<baseResourceName>Immunization</baseResourceName>
|
||||
<baseResourceName>Subscription</baseResourceName>
|
||||
<baseResourceName>ImagingStudy</baseResourceName>
|
||||
<baseResourceName>Provenance</baseResourceName>
|
||||
<baseResourceName>Device</baseResourceName>
|
||||
<baseResourceName>StructureDefinition</baseResourceName>
|
||||
<baseResourceName>Order</baseResourceName>
|
||||
<baseResourceName>Procedure</baseResourceName>
|
||||
<baseResourceName>DiagnosticReport</baseResourceName>
|
||||
<baseResourceName>Medication</baseResourceName>
|
||||
<baseResourceName>MessageHeader</baseResourceName>
|
||||
<baseResourceName>DataElement</baseResourceName>
|
||||
<baseResourceName>DocumentManifest</baseResourceName>
|
||||
<baseResourceName>MedicationAdministration</baseResourceName>
|
||||
<baseResourceName>Encounter</baseResourceName>
|
||||
<baseResourceName>PendedRequest</baseResourceName>
|
||||
<baseResourceName>List</baseResourceName>
|
||||
<baseResourceName>DeviceUseStatement</baseResourceName>
|
||||
<baseResourceName>Goal</baseResourceName>
|
||||
<baseResourceName>NutritionOrder</baseResourceName>
|
||||
<baseResourceName>SearchParameter</baseResourceName>
|
||||
<baseResourceName>ReferralRequest</baseResourceName>
|
||||
<baseResourceName>FamilyHistory</baseResourceName>
|
||||
<baseResourceName>EnrollmentRequest</baseResourceName>
|
||||
<baseResourceName>Location</baseResourceName>
|
||||
<baseResourceName>Contract</baseResourceName>
|
||||
<baseResourceName>Basic</baseResourceName>
|
||||
<baseResourceName>Specimen</baseResourceName>
|
||||
<baseResourceName>EnrollmentResponse</baseResourceName>
|
||||
<baseResourceName>Patient</baseResourceName>
|
||||
<baseResourceName>CarePlan2</baseResourceName>
|
||||
<baseResourceName>DiagnosticOrder</baseResourceName>
|
||||
<baseResourceName>Parameters</baseResourceName>
|
||||
</baseResourceNames>
|
||||
<buildDatatypes>true</buildDatatypes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings
|
||||
only. It has no influence on the Maven build itself. -->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-tinder-plugin</artifactId>
|
||||
<versionRange>[0.4-SNAPSHOT,)</versionRange>
|
||||
<goals>
|
||||
<goal>generate-structures</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<ignore></ignore>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/target/generated-sources/tinder</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/target/generated-resources/tinder</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>${maven_javadoc_plugin_version}</version>
|
||||
<configuration>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
|
@ -1,120 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.io.InputStream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import ca.uhn.fhir.context.ConfigurationException;
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.model.api.IFhirVersion;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.base.composite.BaseCodingDt;
|
||||
import ca.uhn.fhir.model.base.composite.BaseContainedDt;
|
||||
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.dev.composite.CodingDt;
|
||||
import ca.uhn.fhir.model.dev.composite.ContainedDt;
|
||||
import ca.uhn.fhir.model.dev.composite.ResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.dev.resource.StructureDefinition;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.server.Dstu1BundleFactory;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.IVersionSpecificBundleFactory;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import ca.uhn.fhir.rest.server.provider.dev.ServerConformanceProvider;
|
||||
import ca.uhn.fhir.rest.server.provider.dev.ServerProfileProvider;
|
||||
|
||||
public class FhirDev implements IFhirVersion {
|
||||
|
||||
private String myId;
|
||||
|
||||
@Override
|
||||
public ServerConformanceProvider createServerConformanceProvider(RestfulServer theServer) {
|
||||
return new ServerConformanceProvider(theServer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) {
|
||||
StructureDefinition retVal = new StructureDefinition();
|
||||
|
||||
RuntimeResourceDefinition def = theRuntimeResourceDefinition;
|
||||
|
||||
myId = def.getId();
|
||||
if (StringUtils.isBlank(myId)) {
|
||||
myId = theRuntimeResourceDefinition.getName().toLowerCase();
|
||||
}
|
||||
|
||||
retVal.setId(new IdDt(myId));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) {
|
||||
return new ServerProfileProvider(theRestfulServer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FhirVersionEnum getVersion() {
|
||||
return FhirVersionEnum.DEV;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getFhirVersionPropertiesFile() {
|
||||
InputStream str = FhirDev.class.getResourceAsStream("/ca/uhn/fhir/model/dev/fhirversion.properties");
|
||||
if (str == null) {
|
||||
str = FhirDev.class.getResourceAsStream("ca/uhn/fhir/model/dev/fhirversion.properties");
|
||||
}
|
||||
if (str == null) {
|
||||
throw new ConfigurationException("Can not find model property file on classpath: " + "/ca/uhn/fhir/model/dev/model.properties");
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPathToSchemaDefinitions() {
|
||||
return "ca/uhn/fhir/model/dev/schema";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends BaseResourceReferenceDt> getResourceReferenceType() {
|
||||
return ResourceReferenceDt.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends BaseContainedDt> getContainedType() {
|
||||
return ContainedDt.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseCodingDt newCodingDt() {
|
||||
return new CodingDt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext) {
|
||||
return new Dstu1BundleFactory(theContext);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.api;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 ca.uhn.fhir.model.dev.resource.BaseResource;
|
||||
|
||||
public abstract class BaseResourceDev extends BaseResource {
|
||||
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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%
|
||||
*/
|
||||
|
||||
@DatatypeDef(name="AgeDt")
|
||||
public class AgeDt extends QuantityDt {
|
||||
|
||||
}
|
|
@ -1,123 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import ca.uhn.fhir.model.api.IBoundCodeableConcept;
|
||||
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
@DatatypeDef(name = "CodeableConcept", isSpecialization = true)
|
||||
public class BoundCodeableConceptDt<T extends Enum<?>> extends CodeableConceptDt implements IBoundCodeableConcept {
|
||||
|
||||
private IValueSetEnumBinder<T> myBinder;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BoundCodeableConceptDt(IValueSetEnumBinder<T> theBinder) {
|
||||
myBinder = theBinder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BoundCodeableConceptDt(IValueSetEnumBinder<T> theBinder, T theValue) {
|
||||
myBinder = theBinder;
|
||||
setValueAsEnum(theValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public BoundCodeableConceptDt(IValueSetEnumBinder<T> theBinder, Collection<T> theValues) {
|
||||
myBinder = theBinder;
|
||||
setValueAsEnum(theValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link #getCoding()} to contain a coding with the code and
|
||||
* system defined by the given enumerated types, AND clearing any existing
|
||||
* codings first. If theValue is null, existing codings are cleared and no
|
||||
* codings are added.
|
||||
*
|
||||
* @param theValues
|
||||
* The value to add, or <code>null</code>
|
||||
*/
|
||||
public void setValueAsEnum(Collection<T> theValues) {
|
||||
getCoding().clear();
|
||||
if (theValues != null) {
|
||||
for (T next : theValues) {
|
||||
getCoding().add(new CodingDt(myBinder.toSystemString(next), myBinder.toCodeString(next)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link #getCoding()} to contain a coding with the code and
|
||||
* system defined by the given enumerated type, AND clearing any existing
|
||||
* codings first. If theValue is null, existing codings are cleared and no
|
||||
* codings are added.
|
||||
*
|
||||
* @param theValue
|
||||
* The value to add, or <code>null</code>
|
||||
*/
|
||||
public void setValueAsEnum(T theValue) {
|
||||
getCoding().clear();
|
||||
if (theValue == null) {
|
||||
return;
|
||||
}
|
||||
getCoding().add(new CodingDt(myBinder.toSystemString(theValue), myBinder.toCodeString(theValue)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loops through the {@link #getCoding() codings} in this codeable concept
|
||||
* and returns the first bound enumerated type that matches. <b>Use
|
||||
* caution</b> using this method, see the return description for more
|
||||
* information.
|
||||
*
|
||||
* @return Returns the bound enumerated type, or <code>null</code> if none
|
||||
* are found. Note that a null return value doesn't neccesarily
|
||||
* imply that this Codeable Concept has no codes, only that it has
|
||||
* no codes that match the enum.
|
||||
*/
|
||||
public Set<T> getValueAsEnum() {
|
||||
Set<T> retVal = new HashSet<T>();
|
||||
for (CodingDt next : getCoding()) {
|
||||
if (next == null) {
|
||||
continue;
|
||||
}
|
||||
T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString()));
|
||||
if (nextT != null) {
|
||||
retVal.add(nextT);
|
||||
} else {
|
||||
// TODO: throw special exception type?
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.base.composite.BaseContainedDt;
|
||||
|
||||
@DatatypeDef(name = "contained")
|
||||
public class ContainedDt extends BaseContainedDt {
|
||||
|
||||
@Child(name = "resource", type = IResource.class, order = 0, min = 0, max = Child.MAX_UNLIMITED)
|
||||
private List<IResource> myContainedResources;
|
||||
|
||||
public List<IResource> getContainedResources() {
|
||||
if (myContainedResources == null) {
|
||||
myContainedResources = new ArrayList<IResource>();
|
||||
}
|
||||
return myContainedResources;
|
||||
}
|
||||
|
||||
public void setContainedResources(List<IResource> theContainedResources) {
|
||||
myContainedResources = theContainedResources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return myContainedResources == null || myContainedResources.size() == 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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%
|
||||
*/
|
||||
|
||||
@DatatypeDef(name="CountDt")
|
||||
public class CountDt extends QuantityDt {
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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%
|
||||
*/
|
||||
|
||||
@DatatypeDef(name="DistanceDt")
|
||||
public class DistanceDt extends QuantityDt {
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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%
|
||||
*/
|
||||
|
||||
@DatatypeDef(name="DurationDt")
|
||||
public class DurationDt extends QuantityDt {
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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%
|
||||
*/
|
||||
|
||||
@DatatypeDef(name="MoneyDt")
|
||||
public class MoneyDt extends QuantityDt {
|
||||
|
||||
}
|
|
@ -1,175 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.IElement;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.base.composite.BaseNarrativeDt;
|
||||
import ca.uhn.fhir.model.dev.valueset.NarrativeStatusEnum;
|
||||
import ca.uhn.fhir.model.primitive.BoundCodeDt;
|
||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||
import ca.uhn.fhir.model.primitive.XhtmlDt;
|
||||
|
||||
/**
|
||||
* HAPI/FHIR <b>Narrative</b> Datatype
|
||||
* (A human-readable formatted text, including images)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* A human-readable formatted text, including images
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Requirements:</b>
|
||||
*
|
||||
* </p>
|
||||
*/
|
||||
@DatatypeDef(name="Narrative")
|
||||
public class NarrativeDt extends BaseNarrativeDt<NarrativeStatusEnum> {
|
||||
|
||||
@Child(name="status", type=CodeDt.class, order=0, min=1, max=1)
|
||||
private BoundCodeDt<NarrativeStatusEnum> myStatus;
|
||||
|
||||
@Child(name="div", type=XhtmlDt.class, order=1, min=1, max=1)
|
||||
private XhtmlDt myDiv;
|
||||
|
||||
public NarrativeDt() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
public NarrativeDt(XhtmlDt theDiv, NarrativeStatusEnum theStatus) {
|
||||
setDiv(theDiv);
|
||||
setStatus(theStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myDiv );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
|
||||
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements( theType, myStatus, myDiv );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value(s) for <b>status</b> (generated | extensions | additional).
|
||||
* creating it if it does
|
||||
* not exist. Will not return <code>null</code>.
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
|
||||
* </p>
|
||||
*/
|
||||
public BoundCodeDt<NarrativeStatusEnum> getStatus() {
|
||||
if (myStatus == null) {
|
||||
myStatus = new BoundCodeDt<NarrativeStatusEnum>(NarrativeStatusEnum.VALUESET_BINDER);
|
||||
}
|
||||
return myStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value(s) for <b>status</b> (generated | extensions | additional)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
|
||||
* </p>
|
||||
*/
|
||||
public void setStatus(BoundCodeDt<NarrativeStatusEnum> theValue) {
|
||||
myStatus = theValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value(s) for <b>status</b> (generated | extensions | additional)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
|
||||
* </p>
|
||||
*/
|
||||
public void setStatus(NarrativeStatusEnum theValue) {
|
||||
getStatus().setValueAsEnum(theValue);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the value(s) for <b>div</b> (Limited xhtml content).
|
||||
* creating it if it does
|
||||
* not exist. Will not return <code>null</code>.
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* The actual narrative content, a stripped down version of XHTML
|
||||
* </p>
|
||||
*/
|
||||
public XhtmlDt getDiv() {
|
||||
if (myDiv == null) {
|
||||
myDiv = new XhtmlDt();
|
||||
}
|
||||
return myDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value(s) for <b>div</b> (Limited xhtml content)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* The actual narrative content, a stripped down version of XHTML
|
||||
* </p>
|
||||
*/
|
||||
public void setDiv(XhtmlDt theValue) {
|
||||
myDiv = theValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value using a textual DIV (or simple text block which will be
|
||||
* converted to XHTML)
|
||||
*/
|
||||
public void setDiv(String theTextDiv) {
|
||||
myDiv = new XhtmlDt(theTextDiv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,234 +0,0 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package ca.uhn.fhir.model.dev.composite;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.List;
|
||||
|
||||
import ca.uhn.fhir.model.api.ICompositeDatatype;
|
||||
import ca.uhn.fhir.model.api.IElement;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
|
||||
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
|
||||
/**
|
||||
* HAPI/FHIR <b>ResourceReferenceDt</b> Datatype
|
||||
* (A reference from one resource to another)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* A reference from one resource to another
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* <b>Requirements:</b>
|
||||
*
|
||||
* </p>
|
||||
*/
|
||||
@DatatypeDef(name="ResourceReferenceDt")
|
||||
public class ResourceReferenceDt
|
||||
extends BaseResourceReferenceDt implements ICompositeDatatype
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public ResourceReferenceDt() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which creates a resource reference containing the actual resource in question.
|
||||
* <p>
|
||||
* <b> When using this in a server:</b> Generally if this is serialized, it will be serialized as a contained
|
||||
* resource, so this should not be used if the intent is not to actually supply the referenced resource. This is not
|
||||
* a hard-and-fast rule however, as the server can be configured to not serialized this resource, or to load an ID
|
||||
* and contain even if this constructor is not used.
|
||||
* </p>
|
||||
*
|
||||
* @param theResource
|
||||
* The resource instance
|
||||
*/
|
||||
@SimpleSetter()
|
||||
public ResourceReferenceDt(IResource theResource) {
|
||||
super(theResource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute
|
||||
* URL)
|
||||
*
|
||||
* @param theId
|
||||
* The reference itself
|
||||
*/
|
||||
public ResourceReferenceDt(String theId) {
|
||||
setReference(new IdDt(theId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute
|
||||
* URL)
|
||||
*
|
||||
* @param theResourceId
|
||||
* The reference itself
|
||||
*/
|
||||
public ResourceReferenceDt(IdDt theResourceId) {
|
||||
setReference(theResourceId);
|
||||
}
|
||||
|
||||
@Child(name="reference", type=IdDt.class, order=0, min=0, max=1)
|
||||
@Description(
|
||||
shortDefinition="Relative, internal or absolute URL reference",
|
||||
formalDefinition="A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources"
|
||||
)
|
||||
private IdDt myReference;
|
||||
|
||||
@Child(name="display", type=StringDt.class, order=1, min=0, max=1)
|
||||
@Description(
|
||||
shortDefinition="Text alternative for the resource",
|
||||
formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference"
|
||||
)
|
||||
private StringDt myDisplay;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myReference, myDisplay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
|
||||
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myReference, myDisplay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference).
|
||||
* creating it if it does
|
||||
* not exist. Will not return <code>null</code>.
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
|
||||
* </p>
|
||||
*/
|
||||
public IdDt getReference() {
|
||||
if (myReference == null) {
|
||||
myReference = new IdDt();
|
||||
}
|
||||
return myReference;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
|
||||
* </p>
|
||||
*/
|
||||
public ResourceReferenceDt setReference(IdDt theValue) {
|
||||
myReference = theValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value for <b>reference</b> (Relative, internal or absolute URL reference)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
|
||||
* </p>
|
||||
*/
|
||||
public ResourceReferenceDt setReference( String theId) {
|
||||
myReference = new IdDt(theId);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the value(s) for <b>display</b> (Text alternative for the resource).
|
||||
* creating it if it does
|
||||
* not exist. Will not return <code>null</code>.
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* Plain text narrative that identifies the resource in addition to the resource reference
|
||||
* </p>
|
||||
*/
|
||||
public StringDt getDisplay() {
|
||||
if (myDisplay == null) {
|
||||
myDisplay = new StringDt();
|
||||
}
|
||||
return myDisplay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value(s) for <b>display</b> (Text alternative for the resource)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* Plain text narrative that identifies the resource in addition to the resource reference
|
||||
* </p>
|
||||
*/
|
||||
public ResourceReferenceDt setDisplay(StringDt theValue) {
|
||||
myDisplay = theValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value for <b>display</b> (Text alternative for the resource)
|
||||
*
|
||||
* <p>
|
||||
* <b>Definition:</b>
|
||||
* Plain text narrative that identifies the resource in addition to the resource reference
|
||||
* </p>
|
||||
*/
|
||||
public ResourceReferenceDt setDisplay( String theString) {
|
||||
myDisplay = new StringDt(theString);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringDt getDisplayElement() {
|
||||
return getDisplay();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.resource;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import ca.uhn.fhir.model.api.BaseElement;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
|
||||
import ca.uhn.fhir.model.base.resource.ResourceMetadataMap;
|
||||
import ca.uhn.fhir.model.dev.composite.ContainedDt;
|
||||
import ca.uhn.fhir.model.dev.composite.NarrativeDt;
|
||||
import ca.uhn.fhir.model.primitive.CodeDt;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.gclient.StringClientParam;
|
||||
import ca.uhn.fhir.util.ElementUtil;
|
||||
|
||||
public abstract class BaseResource extends BaseElement implements IResource {
|
||||
|
||||
/**
|
||||
* Search parameter constant for <b>_language</b>
|
||||
*/
|
||||
@SearchParamDefinition(name="_language", path="", description="The language of the resource", type="string" )
|
||||
public static final String SP_RES_LANGUAGE = "_language";
|
||||
|
||||
|
||||
/**
|
||||
* Search parameter constant for <b>_id</b>
|
||||
*/
|
||||
@SearchParamDefinition(name="_id", path="", description="The ID of the resource", type="string" )
|
||||
public static final String SP_RES_ID = "_id";
|
||||
|
||||
/**
|
||||
* <b>Fluent Client</b> search parameter constant for <b>_id</b>
|
||||
* <p>
|
||||
* Description: <b>the _id of a resource</b><br>
|
||||
* Type: <b>string</b><br>
|
||||
* Path: <b>Resource._id</b><br>
|
||||
* </p>
|
||||
*/
|
||||
public static final StringClientParam RES_ID = new StringClientParam(BaseResource.SP_RES_ID);
|
||||
|
||||
|
||||
@Child(name = "contained", order = 2, min = 0, max = 1)
|
||||
private ContainedDt myContained;
|
||||
|
||||
private IdDt myId;
|
||||
|
||||
@Child(name = "language", order = 0, min = 0, max = Child.MAX_UNLIMITED)
|
||||
private CodeDt myLanguage;
|
||||
|
||||
private ResourceMetadataMap myResourceMetadata;
|
||||
|
||||
@Child(name = "text", order = 1, min = 0, max = 1)
|
||||
private NarrativeDt myText;
|
||||
|
||||
@Override
|
||||
public ContainedDt getContained() {
|
||||
if (myContained == null) {
|
||||
myContained = new ContainedDt();
|
||||
}
|
||||
return myContained;
|
||||
}
|
||||
|
||||
public IdDt getId() {
|
||||
if (myId == null) {
|
||||
myId = new IdDt();
|
||||
}
|
||||
return myId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodeDt getLanguage() {
|
||||
if (myLanguage == null) {
|
||||
myLanguage = new CodeDt();
|
||||
}
|
||||
return myLanguage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceMetadataMap getResourceMetadata() {
|
||||
if (myResourceMetadata == null) {
|
||||
myResourceMetadata = new ResourceMetadataMap();
|
||||
}
|
||||
return myResourceMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NarrativeDt getText() {
|
||||
if (myText == null) {
|
||||
myText = new NarrativeDt();
|
||||
}
|
||||
return myText;
|
||||
}
|
||||
|
||||
public void setContained(ContainedDt theContained) {
|
||||
myContained = theContained;
|
||||
}
|
||||
|
||||
public void setId(IdDt theId) {
|
||||
myId = theId;
|
||||
}
|
||||
|
||||
public void setId(String theId) {
|
||||
if (theId == null) {
|
||||
myId = null;
|
||||
} else {
|
||||
myId = new IdDt(theId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLanguage(CodeDt theLanguage) {
|
||||
myLanguage = theLanguage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setResourceMetadata(ResourceMetadataMap theMap) {
|
||||
Validate.notNull(theMap, "The Map must not be null");
|
||||
myResourceMetadata = theMap;
|
||||
}
|
||||
|
||||
public void setText(NarrativeDt theText) {
|
||||
myText = theText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
|
||||
b.append("id", getId().toUnqualified());
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Intended to be called by extending classes {@link #isEmpty()} implementations, returns <code>true</code> if all
|
||||
* content in this superclass instance is empty per the semantics of {@link #isEmpty()}.
|
||||
*/
|
||||
@Override
|
||||
protected boolean isBaseEmpty() {
|
||||
return super.isBaseEmpty() && ElementUtil.isEmpty(myLanguage, myText, myId);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,115 +0,0 @@
|
|||
package ca.uhn.fhir.model.dev.resource;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBaseBinary;
|
||||
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.model.api.IElement;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.ResourceDef;
|
||||
import ca.uhn.fhir.model.primitive.Base64BinaryDt;
|
||||
import ca.uhn.fhir.model.primitive.StringDt;
|
||||
import ca.uhn.fhir.util.ElementUtil;
|
||||
|
||||
@ResourceDef(name = "Binary", profile = "http://hl7.org/fhir/profiles/Binary", id = "binary")
|
||||
public class Binary extends BaseResource implements IBaseBinary {
|
||||
|
||||
@Child(name = "content", order = 1)
|
||||
private Base64BinaryDt myContent = new Base64BinaryDt();
|
||||
|
||||
@Child(name = "contentType", order = 0)
|
||||
private StringDt myContentType;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Binary() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param theContentType
|
||||
* The content type
|
||||
* @param theContent
|
||||
* The binary contents
|
||||
*/
|
||||
public Binary(String theContentType, byte[] theContent) {
|
||||
setContentType(theContentType);
|
||||
setContent(theContent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public byte[] getContent() {
|
||||
return myContent.getValue();
|
||||
}
|
||||
|
||||
public String getContentAsBase64() {
|
||||
return myContent.getValueAsString();
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
if (myContentType == null) {
|
||||
return null;
|
||||
}
|
||||
return myContentType.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return (myContent.isEmpty()) && ElementUtil.isEmpty(myContentType);
|
||||
}
|
||||
|
||||
public Binary setContent(byte[] theContent) {
|
||||
myContent.setValue(theContent);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Binary setContentAsBase64(String theContent) {
|
||||
myContent.setValueAsString(theContent);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Binary setContentType(String theContentType) {
|
||||
myContentType = new StringDt(theContentType);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResourceName() {
|
||||
return Binary.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FhirVersionEnum getStructureFhirVersionEnum() {
|
||||
return FhirVersionEnum.DSTU1;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,358 +0,0 @@
|
|||
package ca.uhn.fhir.rest.server.provider.dev;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.context.RuntimeSearchParam;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dev.resource.Conformance;
|
||||
import ca.uhn.fhir.model.dev.resource.Conformance.Rest;
|
||||
import ca.uhn.fhir.model.dev.resource.Conformance.RestResource;
|
||||
import ca.uhn.fhir.model.dev.resource.Conformance.RestResourceInteraction;
|
||||
import ca.uhn.fhir.model.dev.resource.Conformance.RestResourceSearchParam;
|
||||
import ca.uhn.fhir.model.dev.valueset.ResourceTypeEnum;
|
||||
import ca.uhn.fhir.model.dev.valueset.RestfulConformanceModeEnum;
|
||||
import ca.uhn.fhir.model.dev.valueset.SystemRestfulInteractionEnum;
|
||||
import ca.uhn.fhir.model.dev.valueset.TypeRestfulInteractionEnum;
|
||||
import ca.uhn.fhir.model.primitive.DateTimeDt;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.annotation.Metadata;
|
||||
import ca.uhn.fhir.rest.method.BaseMethodBinding;
|
||||
import ca.uhn.fhir.rest.method.DynamicSearchMethodBinding;
|
||||
import ca.uhn.fhir.rest.method.IParameter;
|
||||
import ca.uhn.fhir.rest.method.SearchMethodBinding;
|
||||
import ca.uhn.fhir.rest.method.SearchParameter;
|
||||
import ca.uhn.fhir.rest.server.Constants;
|
||||
import ca.uhn.fhir.rest.server.IServerConformanceProvider;
|
||||
import ca.uhn.fhir.rest.server.ResourceBinding;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
|
||||
|
||||
/**
|
||||
* Server FHIR Provider which serves the conformance statement for a RESTful server implementation
|
||||
*
|
||||
* <p>
|
||||
* Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is always returned unless {@link #setCache(boolean)} is called with a value of
|
||||
* <code>false</code>. This means that if you are adding anything to the returned conformance instance on each call you should call <code>setCache(false)</code> in your provider constructor.
|
||||
* </p>
|
||||
*/
|
||||
public class ServerConformanceProvider implements IServerConformanceProvider<Conformance> {
|
||||
|
||||
private boolean myCache = true;
|
||||
private volatile Conformance myConformance;
|
||||
private String myPublisher = "Not provided";
|
||||
private final RestfulServer myRestfulServer;
|
||||
|
||||
public ServerConformanceProvider(RestfulServer theRestfulServer) {
|
||||
myRestfulServer = theRestfulServer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The
|
||||
* value defaults to "Not provided" but may be set to null, which will cause this element to be omitted.
|
||||
*/
|
||||
public String getPublisher() {
|
||||
return myPublisher;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Metadata
|
||||
public Conformance getServerConformance(HttpServletRequest theRequest) {
|
||||
if (myConformance != null && myCache) {
|
||||
return myConformance;
|
||||
}
|
||||
|
||||
Conformance retVal = new Conformance();
|
||||
|
||||
retVal.setPublisher(myPublisher);
|
||||
retVal.setDate(DateTimeDt.withCurrentTime());
|
||||
retVal.setFhirVersion("0.4.0"); // TODO: pull from model
|
||||
retVal.setAcceptUnknown(false); // TODO: make this configurable - this is a fairly big effort since the parser
|
||||
// needs to be modified to actually allow it
|
||||
|
||||
retVal.getImplementation().setDescription(myRestfulServer.getImplementationDescription());
|
||||
retVal.getSoftware().setName(myRestfulServer.getServerName());
|
||||
retVal.getSoftware().setVersion(myRestfulServer.getServerVersion());
|
||||
retVal.addFormat(Constants.CT_FHIR_XML);
|
||||
retVal.addFormat(Constants.CT_FHIR_JSON);
|
||||
|
||||
Rest rest = retVal.addRest();
|
||||
rest.setMode(RestfulConformanceModeEnum.SERVER);
|
||||
|
||||
Set<SystemRestfulInteractionEnum> systemOps = new HashSet<SystemRestfulInteractionEnum>();
|
||||
|
||||
List<ResourceBinding> bindings = new ArrayList<ResourceBinding>(myRestfulServer.getResourceBindings());
|
||||
Collections.sort(bindings, new Comparator<ResourceBinding>() {
|
||||
@Override
|
||||
public int compare(ResourceBinding theArg0, ResourceBinding theArg1) {
|
||||
return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName());
|
||||
}
|
||||
});
|
||||
|
||||
for (ResourceBinding next : bindings) {
|
||||
|
||||
Set<TypeRestfulInteractionEnum> resourceOps = new HashSet<TypeRestfulInteractionEnum>();
|
||||
RestResource resource = rest.addResource();
|
||||
|
||||
String resourceName = next.getResourceName();
|
||||
RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName);
|
||||
resource.getTypeElement().setValue(def.getName());
|
||||
resource.getProfile().setReference(new IdDt(def.getResourceProfile(myRestfulServer.getServerBaseForRequest(theRequest))));
|
||||
|
||||
TreeSet<String> includes = new TreeSet<String>();
|
||||
|
||||
// Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String,
|
||||
// Conformance.RestResourceSearchParam>();
|
||||
for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {
|
||||
if (nextMethodBinding.getResourceOperationType() != null) {
|
||||
String resOpCode = nextMethodBinding.getResourceOperationType().getCode();
|
||||
if (resOpCode != null) {
|
||||
TypeRestfulInteractionEnum resOp = TypeRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(resOpCode);
|
||||
if (resOp == null) {
|
||||
throw new InternalErrorException("Unknown type-restful-interaction: " + resOpCode);
|
||||
}
|
||||
if (resourceOps.contains(resOp) == false) {
|
||||
resourceOps.add(resOp);
|
||||
resource.addInteraction().setCode(resOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nextMethodBinding.getSystemOperationType() != null) {
|
||||
String sysOpCode = nextMethodBinding.getSystemOperationType().getCode();
|
||||
if (sysOpCode != null) {
|
||||
SystemRestfulInteractionEnum sysOp = SystemRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(sysOpCode);
|
||||
if (sysOp == null) {
|
||||
throw new InternalErrorException("Unknown system-restful-interaction: " + sysOpCode);
|
||||
}
|
||||
if (systemOps.contains(sysOp) == false) {
|
||||
systemOps.add(sysOp);
|
||||
rest.addInteraction().setCode(sysOp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nextMethodBinding instanceof SearchMethodBinding) {
|
||||
handleSearchMethodBinding(rest, resource, resourceName, def, includes, (SearchMethodBinding) nextMethodBinding);
|
||||
} else if (nextMethodBinding instanceof DynamicSearchMethodBinding) {
|
||||
handleDynamicSearchMethodBinding(resource, def, includes, (DynamicSearchMethodBinding) nextMethodBinding);
|
||||
}
|
||||
|
||||
Collections.sort(resource.getInteraction(), new Comparator<RestResourceInteraction>() {
|
||||
@Override
|
||||
public int compare(RestResourceInteraction theO1, RestResourceInteraction theO2) {
|
||||
TypeRestfulInteractionEnum o1 = theO1.getCodeElement().getValueAsEnum();
|
||||
TypeRestfulInteractionEnum o2 = theO2.getCodeElement().getValueAsEnum();
|
||||
if (o1 == null && o2 == null) {
|
||||
return 0;
|
||||
}
|
||||
if (o1 == null) {
|
||||
return 1;
|
||||
}
|
||||
if (o2 == null) {
|
||||
return -1;
|
||||
}
|
||||
return o1.ordinal() - o2.ordinal();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
for (String nextInclude : includes) {
|
||||
resource.addSearchInclude(nextInclude);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
myConformance = retVal;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private void handleDynamicSearchMethodBinding(RestResource resource, RuntimeResourceDefinition def, TreeSet<String> includes, DynamicSearchMethodBinding searchMethodBinding) {
|
||||
includes.addAll(searchMethodBinding.getIncludes());
|
||||
|
||||
List<RuntimeSearchParam> searchParameters = new ArrayList<RuntimeSearchParam>();
|
||||
searchParameters.addAll(searchMethodBinding.getSearchParams());
|
||||
sortRuntimeSearchParameters(searchParameters);
|
||||
|
||||
if (!searchParameters.isEmpty()) {
|
||||
|
||||
for (RuntimeSearchParam nextParameter : searchParameters) {
|
||||
|
||||
String nextParamName = nextParameter.getName();
|
||||
|
||||
// String chain = null;
|
||||
String nextParamUnchainedName = nextParamName;
|
||||
if (nextParamName.contains(".")) {
|
||||
// chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
|
||||
nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
|
||||
}
|
||||
|
||||
String nextParamDescription = nextParameter.getDescription();
|
||||
|
||||
/*
|
||||
* If the parameter has no description, default to the one from the resource
|
||||
*/
|
||||
if (StringUtils.isBlank(nextParamDescription)) {
|
||||
RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
|
||||
if (paramDef != null) {
|
||||
nextParamDescription = paramDef.getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
RestResourceSearchParam param;
|
||||
param = resource.addSearchParam();
|
||||
|
||||
param.setName(nextParamName);
|
||||
// if (StringUtils.isNotBlank(chain)) {
|
||||
// param.addChain(chain);
|
||||
// }
|
||||
param.setDocumentation(nextParamDescription);
|
||||
// param.setType(nextParameter.getParamType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleSearchMethodBinding(Rest rest, RestResource resource, String resourceName, RuntimeResourceDefinition def, TreeSet<String> includes, SearchMethodBinding searchMethodBinding) {
|
||||
includes.addAll(searchMethodBinding.getIncludes());
|
||||
|
||||
List<IParameter> params = searchMethodBinding.getParameters();
|
||||
List<SearchParameter> searchParameters = new ArrayList<SearchParameter>();
|
||||
for (IParameter nextParameter : params) {
|
||||
if ((nextParameter instanceof SearchParameter)) {
|
||||
searchParameters.add((SearchParameter) nextParameter);
|
||||
}
|
||||
}
|
||||
sortSearchParameters(searchParameters);
|
||||
if (!searchParameters.isEmpty()) {
|
||||
// boolean allOptional = searchParameters.get(0).isRequired() == false;
|
||||
//
|
||||
// OperationDefinition query = null;
|
||||
// if (!allOptional) {
|
||||
// RestOperation operation = rest.addOperation();
|
||||
// query = new OperationDefinition();
|
||||
// operation.setDefinition(new ResourceReferenceDt(query));
|
||||
// query.getDescriptionElement().setValue(searchMethodBinding.getDescription());
|
||||
// query.addUndeclaredExtension(false, ExtensionConstants.QUERY_RETURN_TYPE, new CodeDt(resourceName));
|
||||
// for (String nextInclude : searchMethodBinding.getIncludes()) {
|
||||
// query.addUndeclaredExtension(false, ExtensionConstants.QUERY_ALLOWED_INCLUDE, new StringDt(nextInclude));
|
||||
// }
|
||||
// }
|
||||
|
||||
for (SearchParameter nextParameter : searchParameters) {
|
||||
|
||||
String nextParamName = nextParameter.getName();
|
||||
|
||||
String chain = null;
|
||||
String nextParamUnchainedName = nextParamName;
|
||||
if (nextParamName.contains(".")) {
|
||||
chain = nextParamName.substring(nextParamName.indexOf('.') + 1);
|
||||
nextParamUnchainedName = nextParamName.substring(0, nextParamName.indexOf('.'));
|
||||
}
|
||||
|
||||
String nextParamDescription = nextParameter.getDescription();
|
||||
|
||||
/*
|
||||
* If the parameter has no description, default to the one from the resource
|
||||
*/
|
||||
if (StringUtils.isBlank(nextParamDescription)) {
|
||||
RuntimeSearchParam paramDef = def.getSearchParam(nextParamUnchainedName);
|
||||
if (paramDef != null) {
|
||||
nextParamDescription = paramDef.getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
RestResourceSearchParam param = resource.addSearchParam();
|
||||
param.setName(nextParamUnchainedName);
|
||||
if (StringUtils.isNotBlank(chain)) {
|
||||
param.addChain(chain);
|
||||
}
|
||||
param.setDocumentation(nextParamDescription);
|
||||
if (nextParameter.getParamType() != null) {
|
||||
param.getTypeElement().setValueAsString(nextParameter.getParamType().getCode());
|
||||
}
|
||||
for (Class<? extends IResource> nextTarget : nextParameter.getDeclaredTypes()) {
|
||||
RuntimeResourceDefinition targetDef = myRestfulServer.getFhirContext().getResourceDefinition(nextTarget);
|
||||
if (targetDef != null) {
|
||||
ResourceTypeEnum code = ResourceTypeEnum.VALUESET_BINDER.fromCodeString(targetDef.getName());
|
||||
if (code != null) {
|
||||
param.addTarget(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cache property (default is true). If set to true, the same response will be returned for each invocation.
|
||||
* <p>
|
||||
* See the class documentation for an important note if you are extending this class
|
||||
* </p>
|
||||
*/
|
||||
public void setCache(boolean theCache) {
|
||||
myCache = theCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The
|
||||
* value defaults to "Not provided" but may be set to null, which will cause this element to be omitted.
|
||||
*/
|
||||
public void setPublisher(String thePublisher) {
|
||||
myPublisher = thePublisher;
|
||||
}
|
||||
|
||||
private void sortRuntimeSearchParameters(List<RuntimeSearchParam> searchParameters) {
|
||||
Collections.sort(searchParameters, new Comparator<RuntimeSearchParam>() {
|
||||
@Override
|
||||
public int compare(RuntimeSearchParam theO1, RuntimeSearchParam theO2) {
|
||||
return theO1.getName().compareTo(theO2.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sortSearchParameters(List<SearchParameter> searchParameters) {
|
||||
Collections.sort(searchParameters, new Comparator<SearchParameter>() {
|
||||
@Override
|
||||
public int compare(SearchParameter theO1, SearchParameter theO2) {
|
||||
if (theO1.isRequired() == theO2.isRequired()) {
|
||||
return theO1.getName().compareTo(theO2.getName());
|
||||
}
|
||||
if (theO1.isRequired()) {
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package ca.uhn.fhir.rest.server.provider.dev;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR Structures - DEV (FHIR Latest)
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2015 University Health Network
|
||||
* %%
|
||||
* 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 java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.dev.resource.StructureDefinition;
|
||||
import ca.uhn.fhir.model.primitive.IdDt;
|
||||
import ca.uhn.fhir.rest.annotation.IdParam;
|
||||
import ca.uhn.fhir.rest.annotation.Read;
|
||||
import ca.uhn.fhir.rest.annotation.Search;
|
||||
import ca.uhn.fhir.rest.server.IResourceProvider;
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
|
||||
public class ServerProfileProvider implements IResourceProvider {
|
||||
|
||||
private final FhirContext myContext;
|
||||
private final RestfulServer myRestfulServer;
|
||||
|
||||
public ServerProfileProvider(RestfulServer theServer) {
|
||||
myContext = theServer.getFhirContext();
|
||||
myRestfulServer = theServer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IResource> getResourceType() {
|
||||
return StructureDefinition.class;
|
||||
}
|
||||
|
||||
@Read()
|
||||
public StructureDefinition getProfileById(HttpServletRequest theRequest, @IdParam IdDt theId) {
|
||||
RuntimeResourceDefinition retVal = myContext.getResourceDefinitionById(theId.getValue());
|
||||
if (retVal==null) {
|
||||
return null;
|
||||
}
|
||||
String serverBase = getServerBase(theRequest);
|
||||
return (StructureDefinition) retVal.toProfile(serverBase);
|
||||
}
|
||||
|
||||
@Search()
|
||||
public List<StructureDefinition> getAllProfiles(HttpServletRequest theRequest) {
|
||||
final String serverBase = getServerBase(theRequest);
|
||||
List<RuntimeResourceDefinition> defs = new ArrayList<RuntimeResourceDefinition>(myContext.getResourceDefinitions());
|
||||
Collections.sort(defs, new Comparator<RuntimeResourceDefinition>() {
|
||||
@Override
|
||||
public int compare(RuntimeResourceDefinition theO1, RuntimeResourceDefinition theO2) {
|
||||
int cmp = theO1.getName().compareTo(theO2.getName());
|
||||
if (cmp==0) {
|
||||
cmp=theO1.getResourceProfile(serverBase).compareTo(theO2.getResourceProfile(serverBase));
|
||||
}
|
||||
return cmp;
|
||||
}});
|
||||
ArrayList<StructureDefinition> retVal = new ArrayList<StructureDefinition>();
|
||||
for (RuntimeResourceDefinition next : defs) {
|
||||
retVal.add((StructureDefinition) next.toProfile(serverBase));
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
private String getServerBase(HttpServletRequest theHttpRequest) {
|
||||
return myRestfulServer.getServerBaseForRequest(theHttpRequest);
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Alert</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Alert/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>AllergyIntolerance</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:recorder">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:substance">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:substance/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:substance/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:substance">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:substance/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:substance/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:manifestation">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:manifestation/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:manifestation/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:duration">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:exposureRoute">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:exposureRoute/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AllergyIntolerance/f:event/f:exposureRoute/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Appointment</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:slot">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:order">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:participant/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:participant/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:participant/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:participant/f:actor">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Appointment/f:lastModifiedBy">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>AppointmentResponse</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:appointment">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:participantType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:participantType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:participantType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:individual">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:AppointmentResponse/f:lastModifiedBy">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Basic</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Basic/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Binary</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Bundle</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle">
|
||||
<sch:assert test="not(f:entry/f:search) or (f:type/@value = 'transaction')">Inv-2: Search only when transaction</sch:assert>
|
||||
<sch:assert test="not(f:entry/f:status) or (f:type/@value = 'transaction') or (f:type/@value = 'search')">Inv-1: Status only when transaction or search</sch:assert>
|
||||
<sch:assert test="not(f:entry/f:status) or (f:type/@value = 'transaction') or (f:type/@value = 'history')">Inv-5: Status only when transaction or history</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle/f:entry">
|
||||
<sch:assert test="not(f:status) or f:resource">Inv-3: status only when resource</sch:assert>
|
||||
<sch:assert test="not(f:deleted) or not(f:resource)">Inv-4: deleted or resource (but not both)</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle/f:entry/f:resource/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle/f:entry/f:resource/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle/f:entry/f:resource/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Bundle/f:entry/f:resource/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,112 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>CarePlan</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:concern">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:participant/f:role">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:participant/f:role/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:participant/f:role/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:participant/f:member">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:goal/f:concern">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:actionResulting">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:detail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple">
|
||||
<sch:assert test="not(exists(f:detail)) or not(exists(f:simple))">Inv-3: Only provide a detail reference, or a simple detail summary</sch:assert>
|
||||
<sch:assert test="(f:category/@value=('supply')) = exists(f:quantity)">Inv-2: Quantity can only be specified if activity category is supply</sch:assert>
|
||||
<sch:assert test="(f:category/@value=('drug','diet')) = exists(f:dailyAmount)">Inv-1: DailyDose can only be specified if activity category is drug or food</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:scheduledTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:scheduledTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:scheduledTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:scheduledTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:scheduledPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:performer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:product">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:dailyAmount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan/f:activity/f:simple/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>CarePlan2</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:concern">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:participant/f:role">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:participant/f:role/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:participant/f:role/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:participant/f:member">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:goal">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CarePlan2/f:activity">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,181 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ClaimResponse</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:requestProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:requestOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:payeeType">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:payeeType/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:adjudication/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:adjudication/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:adjudication/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:adjudication/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:adjudication/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:adjudication/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:subdetail/f:adjudication/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:subdetail/f:adjudication/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:item/f:detail/f:subdetail/f:adjudication/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:fee">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:adjudication/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:adjudication/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:adjudication/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:fee">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:adjudication/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:adjudication/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:additem/f:detail/f:adjudication/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:error/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:error/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:totalCost">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:unallocDeductable">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:totalBenefit">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentAdjustment">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentAdjustmentReason">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentAdjustmentReason/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentAmount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentRef/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:paymentRef/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:reserved">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:reserved/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:form">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:form/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:note/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClaimResponse/f:note/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ClinicalAssessment</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:assessor">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:previous">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:problem">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:careplan">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:referral">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:investigations/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:investigations/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:investigations/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:investigations/f:item">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:diagnosis/f:item">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:diagnosis/f:item/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:diagnosis/f:item/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:resolved">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:resolved/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:resolved/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:ruledOut/f:item">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:ruledOut/f:item/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:ruledOut/f:item/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:plan">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ClinicalAssessment/f:action">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Communication</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:sender">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:recipient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:payload/f:contentAttachment">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:payload/f:contentReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:medium">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:medium/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:medium/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Communication/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>CommunicationRequest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:sender">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:recipient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:payload/f:contentAttachment">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:payload/f:contentReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:medium">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:medium/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:medium/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:requester">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:priority">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:priority/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:CommunicationRequest/f:priority/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,107 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Composition</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:class">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:class/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:class/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:confidentiality">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:confidentiality/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:attester/f:party">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:custodian">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:event/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:event/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:event/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:event/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:event/f:detail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:section">
|
||||
<sch:assert test="(exists(f:content) and not(exists(f:section))) or (exists(f:section) and not(exists(f:content)))">Inv-2: A section must have either subsections or content</sch:assert>
|
||||
<sch:assert test="not(exists(f:code)) or not(exists(f:content))">Inv-1: A section can only have a code if it has no content</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:section/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:section/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:section/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Composition/f:section/f:content">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,46 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ConceptMap</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ConceptMap/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ConceptMap/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ConceptMap/f:sourceReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ConceptMap/f:targetReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ConceptMap/f:element/f:map">
|
||||
<sch:assert test="exists(f:comments) or ((f:equivalence/@value != 'narrower') and (f:equivalence/@value != 'inexact'))">Inv-1: If the map is narrower or inexact, there SHALL be some comments</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,160 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Condition</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:asserter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:certainty">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:certainty/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:certainty/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:severity">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:severity/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:severity/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:onsetAge">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:abatementAge">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:stage">
|
||||
<sch:assert test="exists(f:summary) or exists(f:assessment)">Inv-1: Stage SHALL have summary or assessment</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:stage/f:summary">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:stage/f:summary/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:stage/f:summary/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:stage/f:assessment">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:evidence">
|
||||
<sch:assert test="exists(f:code) or exists(f:detail)">Inv-2: evidence SHALL have code or details</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:evidence/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:evidence/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:evidence/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:evidence/f:detail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:location">
|
||||
<sch:assert test="exists(f:code) or exists(f:detail)">Inv-3: location SHALL have code or details</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:location/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:location/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:location/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:dueTo">
|
||||
<sch:assert test="exists(f:code) != exists(f:target)">Inv-4: Relationship SHALL have either a code or a target</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:dueTo/f:codeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:dueTo/f:codeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:dueTo/f:codeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:dueTo/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:occurredFollowing">
|
||||
<sch:assert test="exists(f:code) != exists(f:target)">Inv-5: Relationship SHALL have either a code or a target</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:occurredFollowing/f:codeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:occurredFollowing/f:codeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:occurredFollowing/f:codeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Condition/f:occurredFollowing/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,96 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Conformance</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance">
|
||||
<sch:assert test="count(f:software | f:implementation | f:description) > 0">Inv-2: A Conformance statement SHALL have at least one of description, software, or implementation</sch:assert>
|
||||
<sch:assert test="exists(f:rest) or exists(f:messaging) or exists(f:document)">Inv-1: A Conformance statement SHALL have at least one of rest, messaging or document</sch:assert>
|
||||
<sch:assert test="count(f:document[f:mode='producer'])=count(distinct-values(f:document[f:mode='producer']/f:profile/@value)) and count(f:document[f:mode='consumer'])=count(distinct-values(f:document[f:mode='consumer']/f:profile/@value))">Inv-7: The set of documents must be unique by the combination of profile & mode</sch:assert>
|
||||
<sch:assert test="count(f:messaging/f:endpoint)=count(distinct-values(f:messaging/f:endpoint/@value))">Inv-5: The set of end points listed for messaging must be unique</sch:assert>
|
||||
<sch:assert test="count(f:messaging)<=1 or not(f:messaging[not(f:endpoint)])">Inv-4: If there is more than one messaging element, endpoint must be specified for each one</sch:assert>
|
||||
<sch:assert test="count(f:rest)=count(distinct-values(f:rest/f:mode/@value))">Inv-8: There can only be one REST declaration per mode</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:profile">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest">
|
||||
<sch:assert test="count(f:query)=count(distinct-values(f:query/f:name/@value))">Inv-10: A given query can only be described once per RESTful mode</sch:assert>
|
||||
<sch:assert test="count(f:resource)=count(distinct-values(f:resource/f:type/@value))">Inv-9: A given resource can only be described once per RESTful mode</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:security/f:service">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:security/f:service/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:security/f:service/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:resource">
|
||||
<sch:assert test="count(f:operation)=count(distinct-values(f:operation/f:code/@value))">Inv-11: Operation codes must be unique in the context of a resource</sch:assert>
|
||||
<sch:assert test="count(f:searchParam)=count(distinct-values(f:searchParam/f:name/@value))">Inv-12: Search parameter names must be unique in the context of a resource</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:resource/f:profile">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:rest/f:operation/f:definition">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging">
|
||||
<sch:assert test="exists(f:endpoint) = exists(parent::f:Conformance/f:implementation)">Inv-3: Messaging end point is required (and is only permitted) when statement is for an implementation</sch:assert>
|
||||
<sch:assert test="count(f:event[f:mode='sender'])=count(distinct-values(f:event[f:mode='sender']/f:code/@value)) and count(f:event[f:mode='receiver'])=count(distinct-values(f:event[f:mode='receiver']/f:code/@value))">Inv-6: The set of events per messaging endpoint must be unique by the combination of code & mode</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:protocol">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:protocol/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:messaging/f:event/f:response">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Conformance/f:document/f:profile">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,151 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Contract</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:authority">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:domain">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:subtype">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:subtype/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:subtype/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:applies">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:grantor">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:grantee">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:witness">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:executor">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:notary">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:signer/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:signer/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:subtype">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:subtype/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:subtype/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:applies">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:term/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:binding">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:friendly">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:legal">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contract/f:rule">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Contraindication</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:implicated">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:mitigation/f:action">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:mitigation/f:action/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:mitigation/f:action/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Contraindication/f:mitigation/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Coverage</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:issuer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:subscriber">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:network/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:network/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Coverage/f:contract">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,83 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DataElement</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement">
|
||||
<sch:assert test="count(f:concept[f:primary[@value='true']|f:mapping/f:definitional[@value='true']])<=1">Inv-1: Can have a maximum of one definitional binding or primary concept</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:unitsCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:unitsCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:unitsCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:unitsReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:binding">
|
||||
<sch:assert test="(exists(f:valueSet)) or exists(f:description)">Inv-3: provide either a valueSet or a description (or both)</sch:assert>
|
||||
<sch:assert test="not(f:conformance/value='example' and f:isExtensible.value='false')">Inv-14: Example value sets are always extensible</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:binding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DataElement/f:mapping">
|
||||
<sch:assert test="exists(f:uri) or exists(f:name)">Inv-26: Must have at a name or a uri (or both)</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Device</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:owner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:contact">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Device/f:contact/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DeviceComponent</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:source">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:parent">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:operationalStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:operationalStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:operationalStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:parameterGroup">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:parameterGroup/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:parameterGroup/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:productionSpecification/f:specType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:productionSpecification/f:specType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:productionSpecification/f:specType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:productionSpecification/f:componentId/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:productionSpecification/f:componentId/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:languageCode">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:languageCode/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceComponent/f:languageCode/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,86 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DeviceMetric</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:unit">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:unit/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:unit/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:source">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:parent">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementMode/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementMode/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:color/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:color/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementPeriod">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementPeriod/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementPeriod/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceMetric/f:measurementPeriod/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DeviceUseRequest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:bodySite">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:bodySite/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:bodySite/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:device">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:indication">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:indication/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:indication/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:prnReason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:prnReason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:prnReason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:timingTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:timingTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:timingTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:timingTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseRequest/f:timingPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DeviceUseStatement</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:bodySite">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:bodySite/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:bodySite/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:whenUsed">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:device">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:indication">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:indication/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:indication/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:timingTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:timingTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:timingTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:timingTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DeviceUseStatement/f:timingPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,85 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DiagnosticOrder</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:orderer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:supportingInformation">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:specimen">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:event/f:description">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:event/f:description/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:event/f:description/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:event/f:actor">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:specimen">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:bodySite">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:bodySite/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticOrder/f:item/f:bodySite/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,91 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DiagnosticReport</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:name">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:name/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:name/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:performer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:requestDetail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:serviceCategory">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:serviceCategory/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:serviceCategory/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:diagnosticPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:specimen">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:result">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:imagingStudy">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:image/f:link">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:codedDiagnosis">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:codedDiagnosis/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:codedDiagnosis/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DiagnosticReport/f:presentedForm">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DocumentManifest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:masterIdentifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:masterIdentifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:recipient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:supercedes">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:confidentiality">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:confidentiality/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:confidentiality/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentManifest/f:content">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,127 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>DocumentReference</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference">
|
||||
<sch:assert test="exists(f:location) or exists(f:service)">Inv-1: A location or a service (or both) SHALL be provided</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:masterIdentifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:masterIdentifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:class">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:class/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:class/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:custodian">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:authenticator">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:docStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:docStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:docStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:relatesTo/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:confidentiality">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:confidentiality/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:confidentiality/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:service/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:service/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:service/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:event">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:event/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:event/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:facilityType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:facilityType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DocumentReference/f:context/f:facilityType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>EligibilityRequest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityRequest/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>EligibilityResponse</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:requestProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EligibilityResponse/f:requestOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,172 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Encounter</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:statusHistory/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:episodeOfCare">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:participant/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:participant/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:participant/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:participant/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:participant/f:individual">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:fulfills">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:length">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:indication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:priority">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:priority/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:priority/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:preAdmissionIdentifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:origin">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:admitSource">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:admitSource/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:admitSource/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:diet">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:diet/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:diet/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialCourtesy">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialCourtesy/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialCourtesy/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialArrangement">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialArrangement/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:specialArrangement/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:destination">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:dischargeDisposition">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:dischargeDisposition/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:dischargeDisposition/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:hospitalization/f:dischargeDiagnosis">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:location/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:location/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:serviceProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Encounter/f:partOf">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>EnrollmentRequest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:coverage">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:relationship">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentRequest/f:relationship/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>EnrollmentResponse</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:requestProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EnrollmentResponse/f:requestOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>EpisodeOfCare</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:statusHistory/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:managingOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:condition">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:referralRequest">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careManager">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careTeam/f:member">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careTeam/f:role">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careTeam/f:role/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careTeam/f:role/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:EpisodeOfCare/f:careTeam/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ExplanationOfBenefit</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:requestProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExplanationOfBenefit/f:requestOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ExtensionDefinition</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition">
|
||||
<sch:assert test="count(f:element)=count(f:element[(not(preceding-sibling::f:element) and f:path/@value='Extension') or (preceding-sibling::f:element and starts-with(f:path/@value, concat('Extension', '.')))])">Inv-2: All element names must start with the extension name</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:mapping">
|
||||
<sch:assert test="exists(f:uri) or exists(f:name)">Inv-1: Must have at a name or a uri (or both)</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element">
|
||||
<sch:assert test="not(contains(f:path/@value, '.value'))">Inv-3: Path names cannot contain .value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element">
|
||||
<sch:assert test="(f:max/@value = '*') or (f:max/@value >= f:min/@value)">Inv-2: Min <= Max</sch:assert>
|
||||
<sch:assert test="not(exists(f:*[starts-with(local-name(.), 'pattern')])) or (count(f:type)=1 )">Inv-7: Pattern may only be specified if there is one type</sch:assert>
|
||||
<sch:assert test="not(exists(f:*[starts-with(local-name(.), 'fixed')])) or (count(f:type)=1 )">Inv-6: Fixed value may only be specified if there is one type</sch:assert>
|
||||
<sch:assert test="not(exists(f:nameReference) and exists(f:*[starts-with(local-name(.), 'value')]))">Inv-5: Either a namereference or a fixed value (but not both) is permitted</sch:assert>
|
||||
<sch:assert test="count(f:constraint[f:name]) = count(distinct-values(f:constraint/f:name/@value))">Inv-15: Constraint names must be unique.</sch:assert>
|
||||
<sch:assert test="not(exists(f:*[starts-with(local-name(.), 'pattern')])) or not(exists(f:*[starts-with(local-name(.), 'value')]))">Inv-8: Pattern and value are mutually exclusive</sch:assert>
|
||||
<sch:assert test="not(exists(f:*[starts-with(local-name(.), 'fixed')])) or not(exists(f:meaningWhenMissing))">Inv-16: default value and meaningWhenMissing are mutually exclusive</sch:assert>
|
||||
<sch:assert test="not(exists(for $type in f:type return $type/preceding-sibling::f:type[f:code/@value=$type/f:code/@value and f:profile/@value = $type/f:profile/@value]))">Inv-13: Types must be unique by the combination of code and profile</sch:assert>
|
||||
<sch:assert test="count(f:constraint) = count(distinct-values(f:constraint/f:key/@value))">Inv-14: Constraints must be unique by key</sch:assert>
|
||||
<sch:assert test="not(exists(f:binding)) or (count(f:type/f:code) = 0) or f:type/f:code/@value=('code','Coding','CodeableConcept','Quantity','Extension')">Inv-11: Binding can only be present for coded elements</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:slicing">
|
||||
<sch:assert test="(f:discriminator) or (f:description)">Inv-1: If there is no discriminators, there must be a description</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:max">
|
||||
<sch:assert test="@value='*' or (normalize-space(@value)!='' and normalize-space(translate(@value, '0123456789',''))='')">Inv-3: Max SHALL be a number or "*"</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:type">
|
||||
<sch:assert test="not(exists(f:aggregation)) or exists(f:code[@value = 'Reference'])">Inv-4: Aggregation may only be specified if one of the allowed types for the element is a resource</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:binding">
|
||||
<sch:assert test="(exists(f:referenceUri) or exists(f:referenceResource)) or exists(f:description)">Inv-10: provide either a reference or a description (or both)</sch:assert>
|
||||
<sch:assert test="not(f:conformance/@value='example' and f:isExtensible/@value='false')">Inv-9: Example value sets are always extensible</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:binding/f:referenceUri">
|
||||
<sch:assert test="starts-with(@value, 'http:') or starts-with(@value, 'https:')">Inv-12: uri SHALL start with http:// or https://</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ExtensionDefinition/f:element/f:binding/f:referenceReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,112 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>FamilyHistory</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation">
|
||||
<sch:assert test="not (*[starts-with(local-name(.), 'age')] and *[starts-with(local-name(.), 'birth')])">Inv-1: Can have age[x] or birth[x], but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:relationship">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:relationship/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:relationship/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:bornPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:ageAge">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:ageRange">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:ageRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:ageRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:deceasedAge">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:deceasedRange">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:deceasedRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:deceasedRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:outcome">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:outcome/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:outcome/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:onsetAge">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:onsetRange">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:onsetRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:FamilyHistory/f:relation/f:condition/f:onsetRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,132 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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 Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0
|
||||
-->
|
||||
<xs:schema xmlns="http://hl7.org/fhir" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://hl7.org/fhir" elementFormDefault="qualified" version="0.4.0">
|
||||
<xs:include schemaLocation="alert.xsd"/>
|
||||
<xs:include schemaLocation="allergyintolerance.xsd"/>
|
||||
<xs:include schemaLocation="appointment.xsd"/>
|
||||
<xs:include schemaLocation="appointmentresponse.xsd"/>
|
||||
<xs:include schemaLocation="basic.xsd"/>
|
||||
<xs:include schemaLocation="binary.xsd"/>
|
||||
<xs:include schemaLocation="bundle.xsd"/>
|
||||
<xs:include schemaLocation="careplan.xsd"/>
|
||||
<xs:include schemaLocation="careplan2.xsd"/>
|
||||
<xs:include schemaLocation="claimresponse.xsd"/>
|
||||
<xs:include schemaLocation="clinicalassessment.xsd"/>
|
||||
<xs:include schemaLocation="communication.xsd"/>
|
||||
<xs:include schemaLocation="communicationrequest.xsd"/>
|
||||
<xs:include schemaLocation="composition.xsd"/>
|
||||
<xs:include schemaLocation="conceptmap.xsd"/>
|
||||
<xs:include schemaLocation="condition.xsd"/>
|
||||
<xs:include schemaLocation="conformance.xsd"/>
|
||||
<xs:include schemaLocation="contract.xsd"/>
|
||||
<xs:include schemaLocation="contraindication.xsd"/>
|
||||
<xs:include schemaLocation="coverage.xsd"/>
|
||||
<xs:include schemaLocation="dataelement.xsd"/>
|
||||
<xs:include schemaLocation="device.xsd"/>
|
||||
<xs:include schemaLocation="devicecomponent.xsd"/>
|
||||
<xs:include schemaLocation="devicemetric.xsd"/>
|
||||
<xs:include schemaLocation="deviceuserequest.xsd"/>
|
||||
<xs:include schemaLocation="deviceusestatement.xsd"/>
|
||||
<xs:include schemaLocation="diagnosticorder.xsd"/>
|
||||
<xs:include schemaLocation="diagnosticreport.xsd"/>
|
||||
<xs:include schemaLocation="documentmanifest.xsd"/>
|
||||
<xs:include schemaLocation="documentreference.xsd"/>
|
||||
<xs:include schemaLocation="eligibilityrequest.xsd"/>
|
||||
<xs:include schemaLocation="eligibilityresponse.xsd"/>
|
||||
<xs:include schemaLocation="encounter.xsd"/>
|
||||
<xs:include schemaLocation="enrollmentrequest.xsd"/>
|
||||
<xs:include schemaLocation="enrollmentresponse.xsd"/>
|
||||
<xs:include schemaLocation="episodeofcare.xsd"/>
|
||||
<xs:include schemaLocation="explanationofbenefit.xsd"/>
|
||||
<xs:include schemaLocation="extensiondefinition.xsd"/>
|
||||
<xs:include schemaLocation="familyhistory.xsd"/>
|
||||
<xs:include schemaLocation="goal.xsd"/>
|
||||
<xs:include schemaLocation="group.xsd"/>
|
||||
<xs:include schemaLocation="healthcareservice.xsd"/>
|
||||
<xs:include schemaLocation="imagingobjectselection.xsd"/>
|
||||
<xs:include schemaLocation="imagingstudy.xsd"/>
|
||||
<xs:include schemaLocation="immunization.xsd"/>
|
||||
<xs:include schemaLocation="immunizationrecommendation.xsd"/>
|
||||
<xs:include schemaLocation="institutionalclaim.xsd"/>
|
||||
<xs:include schemaLocation="list.xsd"/>
|
||||
<xs:include schemaLocation="location.xsd"/>
|
||||
<xs:include schemaLocation="media.xsd"/>
|
||||
<xs:include schemaLocation="medication.xsd"/>
|
||||
<xs:include schemaLocation="medicationadministration.xsd"/>
|
||||
<xs:include schemaLocation="medicationdispense.xsd"/>
|
||||
<xs:include schemaLocation="medicationprescription.xsd"/>
|
||||
<xs:include schemaLocation="medicationstatement.xsd"/>
|
||||
<xs:include schemaLocation="messageheader.xsd"/>
|
||||
<xs:include schemaLocation="namingsystem.xsd"/>
|
||||
<xs:include schemaLocation="nutritionorder.xsd"/>
|
||||
<xs:include schemaLocation="observation.xsd"/>
|
||||
<xs:include schemaLocation="operationdefinition.xsd"/>
|
||||
<xs:include schemaLocation="operationoutcome.xsd"/>
|
||||
<xs:include schemaLocation="oralhealthclaim.xsd"/>
|
||||
<xs:include schemaLocation="order.xsd"/>
|
||||
<xs:include schemaLocation="orderresponse.xsd"/>
|
||||
<xs:include schemaLocation="organization.xsd"/>
|
||||
<xs:include schemaLocation="other.xsd"/>
|
||||
<xs:include schemaLocation="patient.xsd"/>
|
||||
<xs:include schemaLocation="paymentnotice.xsd"/>
|
||||
<xs:include schemaLocation="paymentreconciliation.xsd"/>
|
||||
<xs:include schemaLocation="pendedrequest.xsd"/>
|
||||
<xs:include schemaLocation="person.xsd"/>
|
||||
<xs:include schemaLocation="pharmacyclaim.xsd"/>
|
||||
<xs:include schemaLocation="practitioner.xsd"/>
|
||||
<xs:include schemaLocation="procedure.xsd"/>
|
||||
<xs:include schemaLocation="procedurerequest.xsd"/>
|
||||
<xs:include schemaLocation="professionalclaim.xsd"/>
|
||||
<xs:include schemaLocation="profile.xsd"/>
|
||||
<xs:include schemaLocation="provenance.xsd"/>
|
||||
<xs:include schemaLocation="questionnaire.xsd"/>
|
||||
<xs:include schemaLocation="questionnaireanswers.xsd"/>
|
||||
<xs:include schemaLocation="readjudicate.xsd"/>
|
||||
<xs:include schemaLocation="referralrequest.xsd"/>
|
||||
<xs:include schemaLocation="relatedperson.xsd"/>
|
||||
<xs:include schemaLocation="reversal.xsd"/>
|
||||
<xs:include schemaLocation="riskassessment.xsd"/>
|
||||
<xs:include schemaLocation="schedule.xsd"/>
|
||||
<xs:include schemaLocation="searchparameter.xsd"/>
|
||||
<xs:include schemaLocation="securityevent.xsd"/>
|
||||
<xs:include schemaLocation="slot.xsd"/>
|
||||
<xs:include schemaLocation="specimen.xsd"/>
|
||||
<xs:include schemaLocation="statusrequest.xsd"/>
|
||||
<xs:include schemaLocation="statusresponse.xsd"/>
|
||||
<xs:include schemaLocation="subscription.xsd"/>
|
||||
<xs:include schemaLocation="substance.xsd"/>
|
||||
<xs:include schemaLocation="supply.xsd"/>
|
||||
<xs:include schemaLocation="supportingdocumentation.xsd"/>
|
||||
<xs:include schemaLocation="valueset.xsd"/>
|
||||
<xs:include schemaLocation="visionclaim.xsd"/>
|
||||
<xs:include schemaLocation="visionprescription.xsd"/>
|
||||
|
||||
</xs:schema>
|
|
@ -1,250 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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 Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0
|
||||
-->
|
||||
<xs:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:osr="http://a9.com/-/opensearch/extensions/relevance/1.0/"
|
||||
xmlns:fhir="http://hl7.org/fhir" xmlns:at="http://purl.org/atompub/tombstones/1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2005/Atom" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
This is a reduced form of the atom schema, that only supports the features profiled in the FHIR specification
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
|
||||
<xs:import namespace="http://hl7.org/fhir" schemaLocation="fhir-single.xsd"/>
|
||||
<xs:import namespace="http://purl.org/atompub/tombstones/1.0" schemaLocation="tombstone.xsd"/>
|
||||
<xs:import namespace="http://a9.com/-/spec/opensearch/1.1/" schemaLocation="opensearch.xsd"/>
|
||||
<xs:import namespace="http://a9.com/-/opensearch/extensions/relevance/1.0/" schemaLocation="opensearchscore.xsd"/>
|
||||
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
|
||||
<xs:element name="feed" type="atom:FeedType"/>
|
||||
<xs:complexType name="TextType" mixed="true">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
The Atom text construct is defined in section 3.1 of the format spec.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:sequence>
|
||||
<xs:any namespace="http://www.w3.org/1999/xhtml" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="text"/>
|
||||
<xs:enumeration value="html"/>
|
||||
<xs:enumeration value="xhtml"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PersonType">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="name" type="xs:string"/>
|
||||
<xs:element name="uri" type="atom:UriType" minOccurs="0"/>
|
||||
</xs:choice>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="FeedType">
|
||||
<xs:sequence>
|
||||
<xs:choice minOccurs="3" maxOccurs="unbounded">
|
||||
<xs:element name="title" type="atom:TextType"/>
|
||||
<xs:element name="updated" type="atom:DateTimeType"/>
|
||||
<xs:element name="id" type="atom:IdType"/>
|
||||
<xs:element name="link" type="atom:LinkType"/>
|
||||
<xs:element name="author" type="atom:PersonType" maxOccurs="unbounded"/>
|
||||
<xs:element name="category" type="atom:CategoryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="entry" type="atom:EntryType"/>
|
||||
<xs:element ref="at:deleted-entry"/>
|
||||
<xs:element ref="os:totalResults"/>
|
||||
<xs:element ref="osr:score"/>
|
||||
</xs:choice>
|
||||
<xs:element ref="ds:Signature" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="EntryType">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="title" type="atom:TextType"/>
|
||||
<xs:element name="link" type="atom:LinkType"/>
|
||||
<xs:element name="id" type="atom:IdType"/>
|
||||
<xs:element name="updated" type="atom:DateTimeType"/>
|
||||
<xs:element name="published" type="atom:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="author" type="atom:PersonType" maxOccurs="unbounded"/>
|
||||
<xs:element name="category" type="atom:CategoryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="content" type="atom:ContentType" minOccurs="0"/>
|
||||
<xs:element name="summary" type="atom:TextType"/>
|
||||
</xs:choice>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CategoryType">
|
||||
<xs:attribute name="term" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="scheme" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="label" type="xs:string" use="optional"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ContentType" mixed="true">
|
||||
<xs:choice>
|
||||
<xs:element ref="fhir:Alert"/>
|
||||
<xs:element ref="fhir:AllergyIntolerance"/>
|
||||
<xs:element ref="fhir:Appointment"/>
|
||||
<xs:element ref="fhir:AppointmentResponse"/>
|
||||
<xs:element ref="fhir:Basic"/>
|
||||
<xs:element ref="fhir:Binary"/>
|
||||
<xs:element ref="fhir:Bundle"/>
|
||||
<xs:element ref="fhir:CarePlan"/>
|
||||
<xs:element ref="fhir:CarePlan2"/>
|
||||
<xs:element ref="fhir:ClaimResponse"/>
|
||||
<xs:element ref="fhir:ClinicalAssessment"/>
|
||||
<xs:element ref="fhir:Communication"/>
|
||||
<xs:element ref="fhir:CommunicationRequest"/>
|
||||
<xs:element ref="fhir:Composition"/>
|
||||
<xs:element ref="fhir:ConceptMap"/>
|
||||
<xs:element ref="fhir:Condition"/>
|
||||
<xs:element ref="fhir:Conformance"/>
|
||||
<xs:element ref="fhir:Contract"/>
|
||||
<xs:element ref="fhir:Contraindication"/>
|
||||
<xs:element ref="fhir:Coverage"/>
|
||||
<xs:element ref="fhir:DataElement"/>
|
||||
<xs:element ref="fhir:Device"/>
|
||||
<xs:element ref="fhir:DeviceComponent"/>
|
||||
<xs:element ref="fhir:DeviceMetric"/>
|
||||
<xs:element ref="fhir:DeviceUseRequest"/>
|
||||
<xs:element ref="fhir:DeviceUseStatement"/>
|
||||
<xs:element ref="fhir:DiagnosticOrder"/>
|
||||
<xs:element ref="fhir:DiagnosticReport"/>
|
||||
<xs:element ref="fhir:DocumentManifest"/>
|
||||
<xs:element ref="fhir:DocumentReference"/>
|
||||
<xs:element ref="fhir:EligibilityRequest"/>
|
||||
<xs:element ref="fhir:EligibilityResponse"/>
|
||||
<xs:element ref="fhir:Encounter"/>
|
||||
<xs:element ref="fhir:EnrollmentRequest"/>
|
||||
<xs:element ref="fhir:EnrollmentResponse"/>
|
||||
<xs:element ref="fhir:EpisodeOfCare"/>
|
||||
<xs:element ref="fhir:ExplanationOfBenefit"/>
|
||||
<xs:element ref="fhir:ExtensionDefinition"/>
|
||||
<xs:element ref="fhir:FamilyHistory"/>
|
||||
<xs:element ref="fhir:Goal"/>
|
||||
<xs:element ref="fhir:Group"/>
|
||||
<xs:element ref="fhir:HealthcareService"/>
|
||||
<xs:element ref="fhir:ImagingObjectSelection"/>
|
||||
<xs:element ref="fhir:ImagingStudy"/>
|
||||
<xs:element ref="fhir:Immunization"/>
|
||||
<xs:element ref="fhir:ImmunizationRecommendation"/>
|
||||
<xs:element ref="fhir:InstitutionalClaim"/>
|
||||
<xs:element ref="fhir:List"/>
|
||||
<xs:element ref="fhir:Location"/>
|
||||
<xs:element ref="fhir:Media"/>
|
||||
<xs:element ref="fhir:Medication"/>
|
||||
<xs:element ref="fhir:MedicationAdministration"/>
|
||||
<xs:element ref="fhir:MedicationDispense"/>
|
||||
<xs:element ref="fhir:MedicationPrescription"/>
|
||||
<xs:element ref="fhir:MedicationStatement"/>
|
||||
<xs:element ref="fhir:MessageHeader"/>
|
||||
<xs:element ref="fhir:NamingSystem"/>
|
||||
<xs:element ref="fhir:NutritionOrder"/>
|
||||
<xs:element ref="fhir:Observation"/>
|
||||
<xs:element ref="fhir:OperationDefinition"/>
|
||||
<xs:element ref="fhir:OperationOutcome"/>
|
||||
<xs:element ref="fhir:OralHealthClaim"/>
|
||||
<xs:element ref="fhir:Order"/>
|
||||
<xs:element ref="fhir:OrderResponse"/>
|
||||
<xs:element ref="fhir:Organization"/>
|
||||
<xs:element ref="fhir:Other"/>
|
||||
<xs:element ref="fhir:Patient"/>
|
||||
<xs:element ref="fhir:PaymentNotice"/>
|
||||
<xs:element ref="fhir:PaymentReconciliation"/>
|
||||
<xs:element ref="fhir:PendedRequest"/>
|
||||
<xs:element ref="fhir:Person"/>
|
||||
<xs:element ref="fhir:PharmacyClaim"/>
|
||||
<xs:element ref="fhir:Practitioner"/>
|
||||
<xs:element ref="fhir:Procedure"/>
|
||||
<xs:element ref="fhir:ProcedureRequest"/>
|
||||
<xs:element ref="fhir:ProfessionalClaim"/>
|
||||
<xs:element ref="fhir:Profile"/>
|
||||
<xs:element ref="fhir:Provenance"/>
|
||||
<xs:element ref="fhir:Questionnaire"/>
|
||||
<xs:element ref="fhir:QuestionnaireAnswers"/>
|
||||
<xs:element ref="fhir:Readjudicate"/>
|
||||
<xs:element ref="fhir:ReferralRequest"/>
|
||||
<xs:element ref="fhir:RelatedPerson"/>
|
||||
<xs:element ref="fhir:Reversal"/>
|
||||
<xs:element ref="fhir:RiskAssessment"/>
|
||||
<xs:element ref="fhir:Schedule"/>
|
||||
<xs:element ref="fhir:SearchParameter"/>
|
||||
<xs:element ref="fhir:SecurityEvent"/>
|
||||
<xs:element ref="fhir:Slot"/>
|
||||
<xs:element ref="fhir:Specimen"/>
|
||||
<xs:element ref="fhir:StatusRequest"/>
|
||||
<xs:element ref="fhir:StatusResponse"/>
|
||||
<xs:element ref="fhir:Subscription"/>
|
||||
<xs:element ref="fhir:Substance"/>
|
||||
<xs:element ref="fhir:Supply"/>
|
||||
<xs:element ref="fhir:SupportingDocumentation"/>
|
||||
<xs:element ref="fhir:ValueSet"/>
|
||||
<xs:element ref="fhir:VisionClaim"/>
|
||||
<xs:element ref="fhir:VisionPrescription"/>
|
||||
|
||||
</xs:choice>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UriType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LinkType" mixed="true">
|
||||
<xs:attribute name="href" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="rel" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="type" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="hreflang" type="xs:NMTOKEN" use="optional"/>
|
||||
<xs:attribute name="title" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="length" type="xs:positiveInteger" use="optional"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IdType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateTimeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:dateTime">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:attributeGroup name="CommonAttributes">
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute ref="xml:lang"/>
|
||||
</xs:attributeGroup>
|
||||
</xs:schema>
|
|
@ -1,250 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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 Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0
|
||||
-->
|
||||
<xs:schema xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:osr="http://a9.com/-/opensearch/extensions/relevance/1.0/"
|
||||
xmlns:fhir="http://hl7.org/fhir" xmlns:at="http://purl.org/atompub/tombstones/1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" targetNamespace="http://www.w3.org/2005/Atom" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
This is a reduced form of the atom schema, that only supports the features profiled in the FHIR specification
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
|
||||
<xs:import namespace="http://hl7.org/fhir" schemaLocation="fhir-all.xsd"/>
|
||||
<xs:import namespace="http://purl.org/atompub/tombstones/1.0" schemaLocation="tombstone.xsd"/>
|
||||
<xs:import namespace="http://a9.com/-/spec/opensearch/1.1/" schemaLocation="opensearch.xsd"/>
|
||||
<xs:import namespace="http://a9.com/-/opensearch/extensions/relevance/1.0/" schemaLocation="opensearchscore.xsd"/>
|
||||
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema.xsd"/>
|
||||
<xs:element name="feed" type="atom:FeedType"/>
|
||||
<xs:complexType name="TextType" mixed="true">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
The Atom text construct is defined in section 3.1 of the format spec.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:sequence>
|
||||
<xs:any namespace="http://www.w3.org/1999/xhtml" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="text"/>
|
||||
<xs:enumeration value="html"/>
|
||||
<xs:enumeration value="xhtml"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PersonType">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="name" type="xs:string"/>
|
||||
<xs:element name="uri" type="atom:UriType" minOccurs="0"/>
|
||||
</xs:choice>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="FeedType">
|
||||
<xs:sequence>
|
||||
<xs:choice minOccurs="3" maxOccurs="unbounded">
|
||||
<xs:element name="title" type="atom:TextType"/>
|
||||
<xs:element name="updated" type="atom:DateTimeType"/>
|
||||
<xs:element name="id" type="atom:IdType"/>
|
||||
<xs:element name="link" type="atom:LinkType"/>
|
||||
<xs:element name="author" type="atom:PersonType" maxOccurs="unbounded"/>
|
||||
<xs:element name="category" type="atom:CategoryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="entry" type="atom:EntryType"/>
|
||||
<xs:element ref="at:deleted-entry"/>
|
||||
<xs:element ref="os:totalResults"/>
|
||||
<xs:element ref="osr:score"/>
|
||||
</xs:choice>
|
||||
<xs:element ref="ds:Signature" minOccurs="0" maxOccurs="1"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="EntryType">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="title" type="atom:TextType"/>
|
||||
<xs:element name="link" type="atom:LinkType"/>
|
||||
<xs:element name="id" type="atom:IdType"/>
|
||||
<xs:element name="updated" type="atom:DateTimeType"/>
|
||||
<xs:element name="published" type="atom:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="author" type="atom:PersonType" maxOccurs="unbounded"/>
|
||||
<xs:element name="category" type="atom:CategoryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="content" type="atom:ContentType" minOccurs="0"/>
|
||||
<xs:element name="summary" type="atom:TextType"/>
|
||||
</xs:choice>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CategoryType">
|
||||
<xs:attribute name="term" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="scheme" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="label" type="xs:string" use="optional"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ContentType" mixed="true">
|
||||
<xs:choice>
|
||||
<xs:element ref="fhir:Alert"/>
|
||||
<xs:element ref="fhir:AllergyIntolerance"/>
|
||||
<xs:element ref="fhir:Appointment"/>
|
||||
<xs:element ref="fhir:AppointmentResponse"/>
|
||||
<xs:element ref="fhir:Basic"/>
|
||||
<xs:element ref="fhir:Binary"/>
|
||||
<xs:element ref="fhir:Bundle"/>
|
||||
<xs:element ref="fhir:CarePlan"/>
|
||||
<xs:element ref="fhir:CarePlan2"/>
|
||||
<xs:element ref="fhir:ClaimResponse"/>
|
||||
<xs:element ref="fhir:ClinicalAssessment"/>
|
||||
<xs:element ref="fhir:Communication"/>
|
||||
<xs:element ref="fhir:CommunicationRequest"/>
|
||||
<xs:element ref="fhir:Composition"/>
|
||||
<xs:element ref="fhir:ConceptMap"/>
|
||||
<xs:element ref="fhir:Condition"/>
|
||||
<xs:element ref="fhir:Conformance"/>
|
||||
<xs:element ref="fhir:Contract"/>
|
||||
<xs:element ref="fhir:Contraindication"/>
|
||||
<xs:element ref="fhir:Coverage"/>
|
||||
<xs:element ref="fhir:DataElement"/>
|
||||
<xs:element ref="fhir:Device"/>
|
||||
<xs:element ref="fhir:DeviceComponent"/>
|
||||
<xs:element ref="fhir:DeviceMetric"/>
|
||||
<xs:element ref="fhir:DeviceUseRequest"/>
|
||||
<xs:element ref="fhir:DeviceUseStatement"/>
|
||||
<xs:element ref="fhir:DiagnosticOrder"/>
|
||||
<xs:element ref="fhir:DiagnosticReport"/>
|
||||
<xs:element ref="fhir:DocumentManifest"/>
|
||||
<xs:element ref="fhir:DocumentReference"/>
|
||||
<xs:element ref="fhir:EligibilityRequest"/>
|
||||
<xs:element ref="fhir:EligibilityResponse"/>
|
||||
<xs:element ref="fhir:Encounter"/>
|
||||
<xs:element ref="fhir:EnrollmentRequest"/>
|
||||
<xs:element ref="fhir:EnrollmentResponse"/>
|
||||
<xs:element ref="fhir:EpisodeOfCare"/>
|
||||
<xs:element ref="fhir:ExplanationOfBenefit"/>
|
||||
<xs:element ref="fhir:ExtensionDefinition"/>
|
||||
<xs:element ref="fhir:FamilyHistory"/>
|
||||
<xs:element ref="fhir:Goal"/>
|
||||
<xs:element ref="fhir:Group"/>
|
||||
<xs:element ref="fhir:HealthcareService"/>
|
||||
<xs:element ref="fhir:ImagingObjectSelection"/>
|
||||
<xs:element ref="fhir:ImagingStudy"/>
|
||||
<xs:element ref="fhir:Immunization"/>
|
||||
<xs:element ref="fhir:ImmunizationRecommendation"/>
|
||||
<xs:element ref="fhir:InstitutionalClaim"/>
|
||||
<xs:element ref="fhir:List"/>
|
||||
<xs:element ref="fhir:Location"/>
|
||||
<xs:element ref="fhir:Media"/>
|
||||
<xs:element ref="fhir:Medication"/>
|
||||
<xs:element ref="fhir:MedicationAdministration"/>
|
||||
<xs:element ref="fhir:MedicationDispense"/>
|
||||
<xs:element ref="fhir:MedicationPrescription"/>
|
||||
<xs:element ref="fhir:MedicationStatement"/>
|
||||
<xs:element ref="fhir:MessageHeader"/>
|
||||
<xs:element ref="fhir:NamingSystem"/>
|
||||
<xs:element ref="fhir:NutritionOrder"/>
|
||||
<xs:element ref="fhir:Observation"/>
|
||||
<xs:element ref="fhir:OperationDefinition"/>
|
||||
<xs:element ref="fhir:OperationOutcome"/>
|
||||
<xs:element ref="fhir:OralHealthClaim"/>
|
||||
<xs:element ref="fhir:Order"/>
|
||||
<xs:element ref="fhir:OrderResponse"/>
|
||||
<xs:element ref="fhir:Organization"/>
|
||||
<xs:element ref="fhir:Other"/>
|
||||
<xs:element ref="fhir:Patient"/>
|
||||
<xs:element ref="fhir:PaymentNotice"/>
|
||||
<xs:element ref="fhir:PaymentReconciliation"/>
|
||||
<xs:element ref="fhir:PendedRequest"/>
|
||||
<xs:element ref="fhir:Person"/>
|
||||
<xs:element ref="fhir:PharmacyClaim"/>
|
||||
<xs:element ref="fhir:Practitioner"/>
|
||||
<xs:element ref="fhir:Procedure"/>
|
||||
<xs:element ref="fhir:ProcedureRequest"/>
|
||||
<xs:element ref="fhir:ProfessionalClaim"/>
|
||||
<xs:element ref="fhir:Profile"/>
|
||||
<xs:element ref="fhir:Provenance"/>
|
||||
<xs:element ref="fhir:Questionnaire"/>
|
||||
<xs:element ref="fhir:QuestionnaireAnswers"/>
|
||||
<xs:element ref="fhir:Readjudicate"/>
|
||||
<xs:element ref="fhir:ReferralRequest"/>
|
||||
<xs:element ref="fhir:RelatedPerson"/>
|
||||
<xs:element ref="fhir:Reversal"/>
|
||||
<xs:element ref="fhir:RiskAssessment"/>
|
||||
<xs:element ref="fhir:Schedule"/>
|
||||
<xs:element ref="fhir:SearchParameter"/>
|
||||
<xs:element ref="fhir:SecurityEvent"/>
|
||||
<xs:element ref="fhir:Slot"/>
|
||||
<xs:element ref="fhir:Specimen"/>
|
||||
<xs:element ref="fhir:StatusRequest"/>
|
||||
<xs:element ref="fhir:StatusResponse"/>
|
||||
<xs:element ref="fhir:Subscription"/>
|
||||
<xs:element ref="fhir:Substance"/>
|
||||
<xs:element ref="fhir:Supply"/>
|
||||
<xs:element ref="fhir:SupportingDocumentation"/>
|
||||
<xs:element ref="fhir:ValueSet"/>
|
||||
<xs:element ref="fhir:VisionClaim"/>
|
||||
<xs:element ref="fhir:VisionPrescription"/>
|
||||
|
||||
</xs:choice>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UriType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LinkType" mixed="true">
|
||||
<xs:attribute name="href" type="xs:anyURI" use="required"/>
|
||||
<xs:attribute name="rel" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="type" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="hreflang" type="xs:NMTOKEN" use="optional"/>
|
||||
<xs:attribute name="title" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="length" type="xs:positiveInteger" use="optional"/>
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IdType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateTimeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:dateTime">
|
||||
<xs:attributeGroup ref="atom:CommonAttributes"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:attributeGroup name="CommonAttributes">
|
||||
<xs:attribute ref="xml:base"/>
|
||||
<xs:attribute ref="xml:lang"/>
|
||||
</xs:attributeGroup>
|
||||
</xs:schema>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,43 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Goal</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Goal/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Goal/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Goal/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Goal/f:concern">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,87 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Group</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group">
|
||||
<sch:assert test="f:actual/@value='true' or not(exists(f:member))">Inv-1: Can only have members if group is "actual"</sch:assert>
|
||||
<sch:assert test="not(f:quantity) or not(f:member) or not(f:quantity>count(f:member))">Inv-4: Can't have more members associated with the group than the value specified for "quantity"</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueQuantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueRange">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:characteristic/f:valueRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:member">
|
||||
<sch:assert test="lower-case(f:type/@value)=parent::f:Group/f:type/@value or (f:type/@value='Patient' and parent::f:Group/f:type/@value=('animal','person'))">Inv-3: Member resource types SHALL agree with group type</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Group/f:member">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,172 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>HealthcareService</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCategory">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCategory/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCategory/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:specialty">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:specialty/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceType/f:specialty/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:freeProvisionCode">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:freeProvisionCode/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:freeProvisionCode/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:eligibility">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:eligibility/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:eligibility/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:appointmentRequired">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:appointmentRequired/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:appointmentRequired/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:availableTime/f:daysOfWeek">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:availableTime/f:daysOfWeek/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:availableTime/f:daysOfWeek/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:contactPoint">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:contactPoint/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:characteristic">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:characteristic/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:characteristic/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:referralMethod">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:referralMethod/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:referralMethod/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:setting">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:setting/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:setting/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:targetGroup">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:targetGroup/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:targetGroup/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:coverageArea">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:coverageArea/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:coverageArea/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:catchmentArea">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:catchmentArea/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:catchmentArea/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCode">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCode/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:HealthcareService/f:serviceCode/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ImagingObjectSelection</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:title">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:title/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:title/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingObjectSelection/f:study/f:series/f:instance">
|
||||
<sch:assert test="f:retrieveAETitle or f:retrieveUrl">Inv-1: SHALL at least provide retrieve URL or retrieve AE Title</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ImagingStudy</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:accession/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:accession/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:order">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:referrer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:procedure">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:procedure/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:interpreter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:series/f:bodySite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:series/f:bodySite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImagingStudy/f:series/f:instance/f:attachment">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,133 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Immunization</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccineType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccineType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccineType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:performer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:requester">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:manufacturer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:site">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:site/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:site/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:route">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:route/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:route/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:doseQuantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:refusalReason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:refusalReason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:explanation/f:refusalReason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:reaction/f:detail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:authority">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseTarget">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseTarget/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseTarget/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatusReason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatusReason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Immunization/f:vaccinationProtocol/f:doseStatusReason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>ImmunizationRecommendation</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:vaccineType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:vaccineType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:vaccineType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:forecastStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:forecastStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:forecastStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:dateCriterion/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:dateCriterion/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:dateCriterion/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:protocol/f:authority">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:supportingImmunization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:ImmunizationRecommendation/f:recommendation/f:supportingPatientInformation">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,253 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>InstitutionalClaim</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:priority">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:priority/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:fundsReserve">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:fundsReserve/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:enterer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:facility">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:payee/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:payee/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:payee/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:payee/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:payee/f:person">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:referral">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:diagnosis/f:diagnosis">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:diagnosis/f:diagnosis/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:condition">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:condition/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:coverage">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:relationship">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:relationship/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:claimResponse">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:coverage/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:exception">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:exception/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:accidentType">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:accidentType/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:interventionException">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:interventionException/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:bodySite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:bodySite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:subsite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:subsite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:modifier">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:modifier/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:item/f:detail/f:subDetail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:additionalMaterials">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:InstitutionalClaim/f:additionalMaterials/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,77 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>List</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List">
|
||||
<sch:assert test="(f:mode/@value = 'changes') or not(exists(f:entry/f:item/f:deleted))">Inv-2: The deleted flag can only be used if the mode of the list is "changes"</sch:assert>
|
||||
<sch:assert test="not(exists(f:emptyReason) and exists(f:entry))">Inv-1: A list can only have an emptyReason if it is empty</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:source">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:entry/f:flag">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:entry/f:flag/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:entry/f:flag/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:entry/f:item">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:emptyReason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:emptyReason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:List/f:emptyReason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Location</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:physicalType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:physicalType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:physicalType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:managingOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Location/f:partOf">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Media</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media">
|
||||
<sch:assert test="(f:type/@value='photo') or not(f:frames)">Inv-3: Frames can only be used for a photo</sch:assert>
|
||||
<sch:assert test="not(f:type/@value='audio') or not(f:width)">Inv-2: Width can only be used for a photo or video</sch:assert>
|
||||
<sch:assert test="not(f:type/@value='audio') or not(f:height)">Inv-1: Height can only be used for a photo or video</sch:assert>
|
||||
<sch:assert test="not(f:type/@value='photo') or not(f:length)">Inv-4: Length can only be used for an audio or a video</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:subtype">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:subtype/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:subtype/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:operator">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:view">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:view/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:view/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Media/f:content">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Medication</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:manufacturer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:form">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:form/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:form/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:ingredient/f:item">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:ingredient/f:amount">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:ingredient/f:amount/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:product/f:ingredient/f:amount/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:package/f:container">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:package/f:container/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:package/f:container/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:package/f:content/f:item">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Medication/f:package/f:content/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,133 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>MedicationAdministration</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration">
|
||||
<sch:assert test="not(exists(f:reasonNotGiven)) or f:wasNotGiven='true'">Inv-2: Reason not given is only permitted if wasNotGiven is true</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:practitioner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:prescription">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:reasonNotGiven">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:reasonNotGiven/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:reasonNotGiven/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:effectiveTimePeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:medication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:device">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage">
|
||||
<sch:assert test="exists(f:quantity) or exists(f:rate)">Inv-1: SHALL have at least one of dosage.quantity and dosage.rate</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:timingPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:asNeededCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:asNeededCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:asNeededCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:site">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:site/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:site/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:route">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:route/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:route/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:method">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:method/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:method/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:rate">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:rate/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:rate/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:maxDosePerPeriod">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:maxDosePerPeriod/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationAdministration/f:dosage/f:maxDosePerPeriod/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,179 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>MedicationDispense</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispenser">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:authorizingPrescription">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense">
|
||||
<sch:assert test="not(exists(f:whenHandedOver/@value)) or not(exists(f:whenPrepared/@value)) or ( f:whenHandedOver/@value >= f:whenPrepared/@value)">Inv-1: whenHandedOver cannot be before whenPrepared</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:medication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:destination">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:receiver">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:additionalInstructions">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:additionalInstructions/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:additionalInstructions/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:schedulePeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:scheduleTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:scheduleTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:scheduleTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:scheduleTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:asNeededCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:asNeededCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:asNeededCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:site">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:site/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:site/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:route">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:route/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:route/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:method">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:method/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:method/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:rate">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:rate/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:rate/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:maxDosePerPeriod">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:maxDosePerPeriod/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:dispense/f:dosage/f:maxDosePerPeriod/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationDispense/f:substitution/f:responsibleParty">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,173 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>MedicationPrescription</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:prescriber">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:reasonCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:reasonCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:reasonCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:reasonReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:medication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:additionalInstructions">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:additionalInstructions/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:additionalInstructions/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:scheduledPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:scheduledTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:scheduledTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:scheduledTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:scheduledTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:asNeededCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:asNeededCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:asNeededCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:site">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:site/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:site/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:route">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:route/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:route/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:method">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:method/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:method/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:doseQuantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:rate">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:rate/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:rate/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:maxDosePerPeriod">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:maxDosePerPeriod/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dosageInstruction/f:maxDosePerPeriod/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dispense/f:medication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dispense/f:validityPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dispense/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:dispense/f:expectedSupplyDuration">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationPrescription/f:substitution/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,131 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>MedicationStatement</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement">
|
||||
<sch:assert test="not(exists(f:reasonNotGiven)) or f:wasNotGiven='true'">Inv-1: Reason not given is only permitted if wasNotGiven is true</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:reasonNotGiven">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:reasonNotGiven/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:reasonNotGiven/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:whenGiven">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:medication">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:device">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:schedule">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:schedule/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:schedule/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:schedule/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:asNeededCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:asNeededCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:asNeededCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:site">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:site/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:site/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:route">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:route/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:route/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:method">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:method/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:method/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:rate">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:rate/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:rate/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:maxDosePerPeriod">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MedicationStatement/f:dosage/f:maxDosePerPeriod/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,73 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>MessageHeader</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:event">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:event/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:response/f:details">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:source/f:contact">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:source/f:contact/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:destination/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:enterer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:receiver">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:responsible">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:reason">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:reason/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:reason/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:MessageHeader/f:data">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,60 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>NamingSystem</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem">
|
||||
<sch:assert test="not(f:replacedBy) or f:status/@value='retired'">Inv-3: Can only have replacedBy if namingsystem is retired</sch:assert>
|
||||
<sch:assert test="not(exists(for $type in distinct-values(f:uniqueId/f:type) return if (count(f:uniqueId[f:type/@value=$type and f:primary/@value='true'])>1) then $type else ()))">Inv-2: Can't have more than one preferred identifier for a type</sch:assert>
|
||||
<sch:assert test="not(f:type/@value='root' and f:uniqueId/f:type=('uuid', 'ruid'))">Inv-1: Root systems cannot have uuid or sid identifiers</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:category">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:category/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:category/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:uniqueId/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:contact/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:contact/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:contact/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NamingSystem/f:replacedBy">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,204 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>NutritionOrder</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:orderer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:allergyIntolerance">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:foodPreferenceModifier">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:foodPreferenceModifier/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:foodPreferenceModifier/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:excludeFoodModifier">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:excludeFoodModifier/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:excludeFoodModifier/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item">
|
||||
<sch:assert test="exists(f:oralDiet) or exists(f:supplement) or exists(f:enteralFormula)">Inv-1: Nutrition Order SHALL contain either Oral Diet , Supplement, or Enteral Formula class</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:scheduledTiming">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:scheduledTiming/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:scheduledTiming/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:scheduledTiming/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:scheduledPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:modifier">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:modifier/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:modifier/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:amountQuantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:amountRange">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:amountRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:nutrients/f:amountRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:modifier">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:modifier/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:modifier/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:foodType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:foodType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:texture/f:foodType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:fluidConsistencyType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:fluidConsistencyType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:oralDiet/f:fluidConsistencyType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:supplement/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:supplement/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:supplement/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:supplement/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:baseFormulaType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:baseFormulaType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:baseFormulaType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:additiveType">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:additiveType/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:additiveType/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:caloricDensity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:routeofAdministration">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:routeofAdministration/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:routeofAdministration/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:rate">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:rate/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:rate/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:rateAdjustment">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:NutritionOrder/f:item/f:enteralFormula/f:maxVolumeToDeliver">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,152 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Observation</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:name">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:name/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:name/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueQuantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueAttachment">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueRatio">
|
||||
<sch:assert test="count(f:numerator) = count(f:denominator)">Inv-1: numerator and denominator SHALL both be present, or both be absent</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueRatio/f:numerator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueRatio/f:denominator">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valuePeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:valueSampledData/f:origin">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:dataAbsentReason">
|
||||
<sch:assert test="not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))">Inv-4: Shall only be present if Observation.value[x] is not present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:interpretation">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:interpretation/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:interpretation/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:appliesPeriod">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:bodySite">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:bodySite/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:bodySite/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:method">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:method/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:method/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:specimen">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:performer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:encounter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange">
|
||||
<sch:assert test="(exists(f:low) or exists(f:high)or exists(f:text)) and not(exists(f:low/f:comparator)) and not(exists(f:high/f:comparator))">Inv-3: Must have at least a low or a high (and no comparators) or text</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:meaning">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:meaning/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:meaning/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:age">
|
||||
<sch:assert test="not(exists(f:low/f:comparator) or exists(f:high/f:comparator))">Inv-3: Quantity values cannot have a comparator when used in a Range</sch:assert>
|
||||
<sch:assert test="not(exists(f:low/f:value/@value)) or not(exists(f:high/f:value/@value)) or (number(f:low/f:value/@value) <= number(f:high/f:value/@value))">Inv-2: If present, low SHALL have a lower value than high</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:age/f:low">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:referenceRange/f:age/f:high">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Observation/f:related/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://a9.com/-/spec/opensearch/1.1/" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:element name="totalResults" type="xs:integer">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Used by a server to inform the client of the total number of search
|
||||
matches (not including including resources)</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:schema>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:os="http://a9.com/-/opensearch/extensions/relevance/1.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="http://a9.com/-/opensearch/extensions/relevance/1.0/" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:element name="score" type="xs:decimal">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Contains a string indicating a relative assessment of relevance for a particular search result with respect to the search query.
|
||||
|
||||
Decimal values less than 0 should be considered equal to 0.
|
||||
|
||||
Decimal values greater than 1 should be considered equal to 1.
|
||||
|
||||
Unparseable or empty values can be ignored by the client.
|
||||
|
||||
Restrictions: The value must contain a decimal representation of a real number between 0 and 1, inclusive.
|
||||
Requirements: This element may appear zero or one time.
|
||||
The score element is used to indicate a relative assessment of relevance for a particular search result with respect to the search query.
|
||||
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:schema>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>OperationDefinition</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:code">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:code/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:base">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:parameter">
|
||||
<sch:assert test="exists(f:type) or exists(f:part)">Inv-1: Either a type must be provided, or parts</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:parameter/f:profile">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationDefinition/f:parameter/f:part/f:profile">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,37 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>OperationOutcome</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationOutcome/f:issue/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OperationOutcome/f:issue/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,283 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>OralHealthClaim</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:priority">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:priority/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:fundsReserve">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:fundsReserve/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:enterer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:facility">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:payee/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:payee/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:payee/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:payee/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:payee/f:person">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:referral">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:diagnosis/f:diagnosis">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:diagnosis/f:diagnosis/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:condition">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:condition/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:coverage">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:relationship">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:relationship/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:claimResponse">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:coverage/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:exception">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:exception/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:accidentType">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:accidentType/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:interventionException">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:interventionException/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:missingteeth/f:tooth">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:missingteeth/f:tooth/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:missingteeth/f:reason">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:missingteeth/f:reason/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:orthoPlan/f:examFee">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:orthoPlan/f:diagnosticFee">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:orthoPlan/f:initialPayment">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:orthoPlan/f:periodicPayment">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:bodySite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:bodySite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:subsite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:subsite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:modifier">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:modifier/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:detail/f:subDetail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:prosthesis/f:priorMaterial">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:item/f:prosthesis/f:priorMaterial/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:additionalMaterials">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OralHealthClaim/f:additionalMaterials/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,89 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Order</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:source">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:reasonCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:reasonCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:reasonCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:reasonReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:authority">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when">
|
||||
<sch:assert test="exists(f:code) != exists(f:schedule)">Inv-1: Provide a code or a schedule, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:schedule">
|
||||
<sch:assert test="not(exists(f:repeat)) or count(f:event) < 2">Inv-1: There can only be a repeat element if there is none or one event</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:schedule/f:event">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:schedule/f:repeat">
|
||||
<sch:assert test="not(exists(f:count) and exists(f:end))">Inv-3: At most, only one of count or end can be present</sch:assert>
|
||||
<sch:assert test="exists(f:frequency) != exists(f:when)">Inv-2: Either frequency or when SHALL be present, but not both</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:when/f:schedule/f:repeat/f:duration">
|
||||
<sch:assert test="@value > 0 or not(@value)">Inv-4: duration SHALL be a positive value</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Order/f:detail">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>OrderResponse</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:who">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:authorityCodeableConcept">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:authorityCodeableConcept/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:authorityCodeableConcept/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:authorityReference">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:OrderResponse/f:fulfillment">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,91 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Organization</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization">
|
||||
<sch:assert test="count(f:identifier | f:name) > 0">Inv-1: The organization SHALL at least have a name or an id, and possibly more than one</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:type">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:type/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:type/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:telecom">
|
||||
<sch:assert test="count(f:use[@value='home']) = 0">Inv-3: The telecom of an organization can never be of use 'home'</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:address">
|
||||
<sch:assert test="count(f:use[@value='home']) = 0">Inv-2: An address of an organization can never be of use 'home'</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:partOf">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:purpose">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:purpose/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:purpose/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:contact/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Organization/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Other</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:subject">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Other/f:author">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,136 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Patient</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:maritalStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:maritalStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:maritalStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:photo">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact">
|
||||
<sch:assert test="f:name or f:telecom or f:address or f:organization">Inv-1: SHALL at least contain a contact's details or a reference to an organization</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:relationship">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:relationship/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:relationship/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:contact/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:species">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:species/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:species/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:breed">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:breed/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:breed/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:genderStatus">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:genderStatus/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:animal/f:genderStatus/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:communication">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:communication/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:communication/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:careProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:managingOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Patient/f:link/f:other">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>PaymentNotice</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:response">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:paymentStatus">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentNotice/f:paymentStatus/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,100 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>PaymentReconciliation</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:requestProvider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:requestOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:responce">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:submitter">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:payee">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:detail/f:amount">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:form">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:form/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:total">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:note/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PaymentReconciliation/f:note/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>PendedRequest</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:request">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PendedRequest/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Person</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:photo">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:managingOrganization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Person/f:link/f:other">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,259 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>PharmacyClaim</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:ruleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:ruleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:target">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:priority">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:priority/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:fundsReserve">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:fundsReserve/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:enterer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:facility">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:prescription">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:originalPrescription">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:payee/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:payee/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:payee/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:payee/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:payee/f:person">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:referral">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:diagnosis/f:diagnosis">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:diagnosis/f:diagnosis/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:condition">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:condition/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:patient">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:coverage">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:relationship">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:relationship/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:claimResponse">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:originalRuleset">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:coverage/f:originalRuleset/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:exception">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:exception/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:accidentType">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:accidentType/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:interventionException">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:interventionException/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:provider">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:bodySite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:bodySite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:subsite">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:subsite/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:modifier">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:modifier/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:type">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:type/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:service">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:service/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:quantity">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:unitPrice">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:net">
|
||||
<sch:assert test="not(exists(f:code)) or exists(f:system)">Inv-3: If a code for the units is present, the system SHALL also be present</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:udi">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:item/f:detail/f:subDetail/f:udi/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:additionalMaterials">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:PharmacyClaim/f:additionalMaterials/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
|
@ -1,109 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
||||
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
||||
<sch:ns prefix="a" uri="http://www.w3.org/2005/Atom"/>
|
||||
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
||||
<sch:pattern>
|
||||
<sch:title>Practitioner</sch:title>
|
||||
<sch:rule context="/f:DomainResource">
|
||||
<sch:assert test="exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))])">Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:contained)">Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources</sch:assert>
|
||||
<sch:assert test="not(parent::f:contained and f:text)">Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:text/f:div">
|
||||
<sch:assert test="not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])">Inv-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
<sch:assert test="descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]">Inv-2: The narrative SHALL have some non-whitespace content</sch:assert>
|
||||
<sch:assert test="not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))])">Inv-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:security/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:DomainResource/f:contained/f:meta/f:tag/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:name/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:telecom">
|
||||
<sch:assert test="not(exists(f:value)) or exists(f:system)">Inv-2: A system is required if a value is provided.</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:telecom/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:address/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:photo">
|
||||
<sch:assert test="not(exists(f:data)) or exists(f:contentType)">Inv-1: It the Attachment has data, it SHALL have a contentType</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:organization">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:role">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:role/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:role/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:specialty">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:specialty/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:specialty/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:location">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:identifier/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:identifier/f:assigner">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:code">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:code/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:code/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:period">
|
||||
<sch:assert test="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)">Inv-1: If present, start SHALL have a lower value than end</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:qualification/f:issuer">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:communication">
|
||||
<sch:assert test="count(f:coding[f:primary/@value='true'])<=1">Inv-2: Only one coding in a set can be chosen directly by the user</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:communication/f:coding">
|
||||
<sch:assert test="not (exists(f:valueSet) and exists(f:code)) or exists(f:system)">Inv-1: If a valueSet is provided, a system URI Is required</sch:assert>
|
||||
</sch:rule>
|
||||
<sch:rule context="/f:Practitioner/f:communication/f:coding/f:valueSet">
|
||||
<sch:assert test="not(starts-with(f:reference/@value, '#')) or exists(ancestor::a:content/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])">Inv-1: SHALL have a local reference if the resource is provided inline</sch:assert>
|
||||
</sch:rule>
|
||||
</sch:pattern>
|
||||
</sch:schema>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue