PackagesCanonicalsLogsProblems
    Packages
    ch.fhir.ig.ch-epr-fhir@4.0.0-ballot
    http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/PpqmFeedRequestBundle
description: Bundle for Mobile Privacy Policy Bundle Feed requests
package_name: ch.fhir.ig.ch-epr-fhir
derivation: constraint
name: PpqmFeedRequestBundle
type: Bundle
elements:
  type:
    pattern: {type: Code, value: transaction}
    index: 0
  entry:
    constraint:
      ch-epr-ppqm-constistent-ids:
        human: For PUT, policy set ID in the embedded resource shall be the same as in the entry URL
        source: http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/PpqmFeedRequestBundle
        severity: error
        expression: |-
          (request.method != 'PUT') or (resource.identifier.where(
                              type.coding.exists((system = 'http://fhir.ch/ig/ch-epr-fhir/CodeSystem/PpqmConsentIdentifierType') and (code = 'policySetId'))
                          ).value.lower() = request.url.substring(19).lower())
    index: 1
    elements:
      resource: {type: Consent, index: 2}
      request:
        constraint:
          ch-epr-ppqm-url-format:
            human: URL format shall suit the HTTP method
            source: http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/PpqmFeedRequestBundle
            severity: error
            expression: |-
              (
                                  (method = 'POST') and (url = 'Consent')
                              ) or (
                                  (method != 'POST') and url.startsWith('Consent?identifier=') and url.lower().matches('^consent\\?identifier=urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$')
                              )
        index: 3
        elements:
          method:
            binding: {strength: required, valueSet: 'http://fhir.ch/ig/ch-epr-fhir/ValueSet/PpqmFeedRequestHttpMethod'}
            index: 4
          ifNoneMatch: {index: 5}
          ifModifiedSince: {index: 6}
          ifMatch: {index: 7}
          ifNoneExist: {index: 8}
package_version: 4.0.0-ballot
class: profile
kind: resource
url: http://fhir.ch/ig/ch-epr-fhir/StructureDefinition/PpqmFeedRequestBundle
base: http://hl7.org/fhir/StructureDefinition/Bundle
version: 4.0.0-ballot
required: [entry]