From 8c5fe13259e2f44ca945af5a23b2d0440b007d41 Mon Sep 17 00:00:00 2001
From: VHofman <vincent.hofman@kereval.com>
Date: Fri, 26 Apr 2024 09:22:16 +0200
Subject: [PATCH] Set the traceparent's presense as optional (0..*) and add a
 condition to "traceparent_parameter_value" rule for both validation profiles.

---
 ...nt-Mobile Patient Demographics Query-ValidationProfile.json | 3 ++-
 ...Mobile Patient Demographics Retrieve-ValidationProfile.json | 3 ++-
 EHS/CH-PDQm/README.md                                          | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Query-ValidationProfile.json b/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Query-ValidationProfile.json
index 162e0b1..40cad47 100644
--- a/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Query-ValidationProfile.json	
+++ b/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Query-ValidationProfile.json	
@@ -96,7 +96,7 @@
       "checks": [
         {
           "type": "OCCURRENCE",
-          "minOccurrence": 1,
+          "minOccurrence": 0,
           "maxOccurrence": 1
         }
       ]
@@ -107,6 +107,7 @@
       "description": "traceparent parameter's value SHALL be as defined in fhir.ch, section tracecontext.",
       "requirementPriority": "MANDATORY",
       "checksComposition": "oneOf",
+      "applyIf": "request.headers('traceparent').values.size() > 0",
       "checks": [
         {
           "type": "REGEX",
diff --git a/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Retrieve-ValidationProfile.json b/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Retrieve-ValidationProfile.json
index 8d71697..9729052 100644
--- a/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Retrieve-ValidationProfile.json	
+++ b/EHS/CH-PDQm/CH-ITI-78-Patient-Mobile Patient Demographics Retrieve-ValidationProfile.json	
@@ -93,7 +93,7 @@
       "checks": [
         {
           "type": "OCCURRENCE",
-          "minOccurrence": 1,
+          "minOccurrence": 0,
           "maxOccurrence": 1
         }
       ]
@@ -104,6 +104,7 @@
       "description": "traceparent parameter's value SHALL be as defined in fhir.ch, section tracecontext.",
       "requirementPriority": "MANDATORY",
       "checksComposition": "oneOf",
+      "applyIf": "request.headers('traceparent').values.size() > 0",
       "checks": [
         {
           "type": "REGEX",
diff --git a/EHS/CH-PDQm/README.md b/EHS/CH-PDQm/README.md
index f83e4ed..0dd9ef3 100644
--- a/EHS/CH-PDQm/README.md
+++ b/EHS/CH-PDQm/README.md
@@ -2,7 +2,7 @@
 title: CH:PDQm HTTP Validation profiles' assertions 
 subtitle: List of all HTTP rules for CH:PDQm/ITI-78
 authors: Vincent HOFMAN
-date: 2023-03-26
+date: 2024-03-26
 ---
 
 # CH:PDQm Mobile Patient Demographics Query's validation profile
-- 
GitLab