Validator
LOG IN
SIGN UP
Scope
package:hl7.fhir.r4.core@4.0.1
Readonly
If you
Log in
or
sign up
, you can edit this script yourself.
<?xml version="1.0" encoding="UTF-8"?> <TestScript xmlns="http://hl7.org/fhir" xmlns:nts="http://nictiz.nl/xsl/testscript"> <id value="phr-1-send-one-correctionrequest"/> <url value="http://nictiz.nl/fhir/TestScript/phr-1-send-one-correctionrequest"/> <version value="r4-1.0.0-patchlevel 2025.35"/> <name value="PatientCorrections - PHR Client - Scenario 1 - Send one correction request"/> <status value="active"/> <publisher value="Nictiz"/> <contact> <name value="Nictiz"/> <telecom> <system value="email"/> <value value="kwalificatie@nictiz.nl"/> <use value="work"/> </telecom> </contact> <description value="Scenario 1 - Send one correction request"/> <origin> <extension url="http://fhir.interoplab.eu/fhir/StructureDefinition/Interoplab-CL-ext-SUT"> <valueBoolean value="true"/> </extension> <index value="1"/> <profile> <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/> <code value="FHIR-Client"/> </profile> </origin> <destination> <extension url="http://fhir.interoplab.eu/fhir/StructureDefinition/Interoplab-CL-ext-SUT"> <valueBoolean value="false"/> </extension> <index value="1"/> <profile> <system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/> <code value="FHIR-Server"/> </profile> </destination> <fixture id="scenario-1-bundle-fixture"> <autocreate value="false"/> <autodelete value="false"/> <resource> <reference value="../_reference/resources-specific/dwv-Transaction-Scenario-1.xml"/> </resource> </fixture> <profile id="Bundle-profile" value="http://hl7.org/fhir/StructureDefinition/Bundle"/> <variable> <name value="T"/> <defaultValue value="${CURRENTDATE}"/> <description value="Date that data and queries are expected to be relative to."/> </variable> <test id="scenario1-send-one-correctionrequest"> <name value="Scenario1"/> <description value="Send one correction request"/> <action> <operation> <type> <system value="http://hl7.org/fhir/restful-interaction"/> <code value="transaction"/> </type> <description value="Test PHR client to POST a Bundle of type transaction."/> <destination value="1"/> <encodeRequestUrl value="true"/> <origin value="1"/> <requestHeader> <field value="Authorization"/> <value value="Bearer 52d1157f-08fc-4519-8458-82427de17fb7"/> </requestHeader> <requestHeader> <field value="MedMij-Request-ID"/> <value value="${UUID}"/> </requestHeader> <requestHeader> <field value="Prefer"/> <value value="return=representation"/> </requestHeader> <sourceId value="scenario-1-bundle-fixture"/> </operation> </action> <action> <assert> <description value="Confirm that request Bundle is of type transaction."/> <direction value="request"/> <expression value="Bundle.type = 'transaction'"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that HTTP header Authorization contains the patient token Bearer 52d1157f-08fc-4519-8458-82427de17fb7"/> <direction value="request"/> <headerField value="Authorization"/> <stopTestOnFail value="false"/> <value value="Bearer 52d1157f-08fc-4519-8458-82427de17fb7"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that query parameter 'patient=' was not present to avoid BSNs in the URL."/> <direction value="request"/> <operator value="notContains"/> <requestURL value="patient="/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that query parameter 'subject=' was not present to avoid BSNs in the URL."/> <direction value="request"/> <operator value="notContains"/> <requestURL value="subject="/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all resources that are updated contain a Resource.id and a fullUrl."/> <direction value="request"/> <expression value="Bundle.entry.where(request.method='PUT').all( $this.fullUrl.exists() and $this.resource.id.exists())"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all resources that are created don't contain a Resource.id. Warning only because it not forbidden, however, the resource does not need to have an id element. If an id is provided, the server SHALL ignore it."/> <direction value="request"/> <expression value="Bundle.entry.where(request.method='POST').all($this.resource.id.exists().not())"/> <stopTestOnFail value="false"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that all resources that are created don't have a RESTful fullUrl."/> <direction value="request"/> <expression value="Bundle.entry.where(request.method='POST').all( $this.fullUrl.startsWith('http://').not() and $this.fullUrl.startsWith('https://').not() )"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all resources that are created don't have a fullUrl or have a UUID or OID based fullUrl."/> <direction value="request"/> <expression value="Bundle.entry.where(request.method='POST').fullUrl.all( exists().not or matches('^urn:oid:[0-2](\\.(0|[1-9]\\d*))*$') or matches('^urn:uuid:[A-Fa-f\\d]{8}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{12}$') )"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all posted resources except Binary contain a meta.profile tag."/> <direction value="request"/> <expression value="Bundle.entry.resource.where(is(Binary).not()).where(meta.profile.empty()).empty()"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the fullUrl does not disagree with the id in the resource, see http://hl7.org/fhir/stu3/bundle-definitions.html#Bundle.entry.fullUrl"/> <direction value="request"/> <expression value="Bundle.entry.where(fullUrl.exists() and resource.id.exists()).all($this.fullUrl.endsWith($this.resource.id))"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the fullUrl is an absolute URL, an uuid or an oid."/> <direction value="request"/> <expression value="Bundle.entry.fullUrl.all( startsWith('http://') or startsWith('https://') or matches('^urn:oid:[0-2](\\.(0|[1-9]\\d*))*$') or matches('^urn:uuid:[A-Fa-f\\d]{8}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{4}-[A-Fa-f\\d]{12}$') )"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the returned Bundle conforms to the base FHIR specification and the resources to the stated profiles in the meta.profile tag."/> <direction value="request"/> <stopTestOnFail value="false"/> <validateProfileId value="Bundle-profile"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all Coding elements contain both a .system and a .code."/> <direction value="request"/> <expression value="Bundle.descendants().where($this.is(Coding)).all(system.exists() and code.exists())"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the OID of the zib valueset is not used for the system of a coding element."/> <direction value="request"/> <expression value="Bundle.descendants().where($this.is(coding)).where(system.startsWith('urn:oid:2.16.840.1.113883.2.4.3.11.60.40.2')).exists().not()"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all CodeableConcept elements contain either a coding.display or a text value if no Coding exists or has an extension (e.g. a nullFlavor or data-absent-reason extension). For more information see https://informatiestandaarden.nictiz.nl/wiki/FHIR:V1.0_FHIR_IG_STU3Use_of_coded_concepts."/> <direction value="request"/> <expression value="Bundle.descendants().where($this.is(CodeableConcept)) .all(coding.display.exists() or text.exists() or extension.exists())"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all References have a display value, see https://informatiestandaarden.nictiz.nl/wiki/FHIR:V1.0_FHIR_IG_STU3#Use_of_the_reference_datatype."/> <direction value="request"/> <expression value="Bundle.descendants().where($this.is(Reference)).all(display.exists() or extension.where(url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason').exists() or extension.where(url = 'http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor').exists())"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that all Identifiers have both a .system and a .value. In rare cases where a general category of identifiers can be used, .type can replace .system. Edge cases for both .system and .type to be unknown are not applicable to Nictiz. For more information, see https://www.hl7.org/fhir/stu3/datatypes.html#Identifier."/> <direction value="request"/> <expression value="Bundle.descendants().where($this.is(Identifier)).all((system.exists() or type.exists()) and value.exists())"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that Bundle does not use Burgerservicenummer (BSN) anywhere."/> <direction value="request"/> <expression value="Bundle.descendants().select(identifier.where(system = 'http://fhir.nl/fhir/NamingSystem/bsn').where(value.empty().not() and value.extension.exists().not())).count() = 0"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the operation was successful"/> <operator value="in"/> <responseCode value="200,201"/> <stopTestOnFail value="true"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Make sure the server of the test simulator handles each resource in the batch Bundle correctly"/> <direction value="response"/> <expression value="Bundle.response.status.all($this.startsWith('200') or $this.startsWith('201'))"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the request Bundle contains 1 Patient resource(s). "/> <direction value="request"/> <expression value="Bundle.entry.where(resource.is(Patient)).count() = 1"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the request Bundle contains 1 Organization resource(s). "/> <direction value="request"/> <expression value="Bundle.entry.where(resource.is(Organization)).count() = 1"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that the request Bundle contains 1 Communication resource(s). "/> <direction value="request"/> <expression value="Bundle.entry.where(resource.is(Communication)).count() = 1"/> <stopTestOnFail value="false"/> <warningOnly value="false"/> </assert> </action> <action> <assert> <description value="Confirm that that the HTTP Prefer header with value 'return=representation' is present in the request."/> <direction value="request"/> <headerField value="Prefer"/> <stopTestOnFail value="false"/> <value value="return=representation"/> <warningOnly value="false"/> </assert> </action> </test> </TestScript>
Overview
Errors (1)
Warnings (0)
Messages (0)
Error
: Type checking the data: Since type Reference is not a primitive, it cannot have a value (at TestScript.profile[0])
Validated using the Validator Firely .NET SDK validator