From 66a4d5ab3bf1e74ee0b474d97993af5ee2877ba4 Mon Sep 17 00:00:00 2001
From: VHofman <vincent.hofman@kereval.com>
Date: Tue, 9 Apr 2024 16:16:27 +0200
Subject: [PATCH] Add HTTP error codes in documentation + Fix Traceparent's
 regex

---
 ...Organization-GetRequest-ValidationProfile.json |  2 +-
 ...Practitioner-GetRequest-ValidationProfile.json |  2 +-
 ...titionerRole-GetRequest-ValidationProfile.json |  2 +-
 ...-ITI-90-RetrieveRequest-ValidationProfile.json |  2 +-
 EHS/CH_mCSD/README.md                             | 15 ++++++++++++---
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/EHS/CH_mCSD/CH-ITI-90-Organization-GetRequest-ValidationProfile.json b/EHS/CH_mCSD/CH-ITI-90-Organization-GetRequest-ValidationProfile.json
index 09eaadb..6b42f90 100644
--- a/EHS/CH_mCSD/CH-ITI-90-Organization-GetRequest-ValidationProfile.json
+++ b/EHS/CH_mCSD/CH-ITI-90-Organization-GetRequest-ValidationProfile.json
@@ -109,7 +109,7 @@
           "checks": [
             {
               "type": "REGEX",
-              "regex": "^(?!f{2})([\\da-f]{2})-(?!f{32})([\\da-f]{32})-(?!f{16})([\\da-f]{16})-(?!f{2})([\\da-f]{2})$"
+              "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$"
             }
           ]
         },
diff --git a/EHS/CH_mCSD/CH-ITI-90-Practitioner-GetRequest-ValidationProfile.json b/EHS/CH_mCSD/CH-ITI-90-Practitioner-GetRequest-ValidationProfile.json
index 40a2659..0fe8e9b 100644
--- a/EHS/CH_mCSD/CH-ITI-90-Practitioner-GetRequest-ValidationProfile.json
+++ b/EHS/CH_mCSD/CH-ITI-90-Practitioner-GetRequest-ValidationProfile.json
@@ -110,7 +110,7 @@
       "checks": [
         {
           "type": "REGEX",
-          "regex": "^(?!f{2})([\\da-f]{2})-(?!f{32})([\\da-f]{32})-(?!f{16})([\\da-f]{16})-(?!f{2})([\\da-f]{2})$"
+          "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$"
         }
       ]
     },
diff --git a/EHS/CH_mCSD/CH-ITI-90-PractitionerRole-GetRequest-ValidationProfile.json b/EHS/CH_mCSD/CH-ITI-90-PractitionerRole-GetRequest-ValidationProfile.json
index f68dcbd..42ce0d0 100644
--- a/EHS/CH_mCSD/CH-ITI-90-PractitionerRole-GetRequest-ValidationProfile.json
+++ b/EHS/CH_mCSD/CH-ITI-90-PractitionerRole-GetRequest-ValidationProfile.json
@@ -110,7 +110,7 @@
       "checks": [
         {
           "type": "REGEX",
-          "regex": "^(?!f{2})([\\da-f]{2})-(?!f{32})([\\da-f]{32})-(?!f{16})([\\da-f]{16})-(?!f{2})([\\da-f]{2})$"
+          "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$"
         }
       ]
     },
diff --git a/EHS/CH_mCSD/CH-ITI-90-RetrieveRequest-ValidationProfile.json b/EHS/CH_mCSD/CH-ITI-90-RetrieveRequest-ValidationProfile.json
index e1f4d9f..6c1fc85 100644
--- a/EHS/CH_mCSD/CH-ITI-90-RetrieveRequest-ValidationProfile.json
+++ b/EHS/CH_mCSD/CH-ITI-90-RetrieveRequest-ValidationProfile.json
@@ -109,7 +109,7 @@
           "checks": [
             {
               "type": "REGEX",
-              "regex": "^(?!f{2})([\\da-f]{2})-(?!f{32})([\\da-f]{32})-(?!f{16})([\\da-f]{16})-(?!f{2})([\\da-f]{2})$"
+              "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$"
             }
           ]
         }
diff --git a/EHS/CH_mCSD/README.md b/EHS/CH_mCSD/README.md
index c8d2d6e..b6891f8 100644
--- a/EHS/CH_mCSD/README.md
+++ b/EHS/CH_mCSD/README.md
@@ -11,14 +11,14 @@ date: 2023-03-14
 
 |   id  |   Check's type |   Value |   Description    |
 |---    |---    |---    |---    |
-|   GETMethodChecking   |   FIXEDVALUE |   GET |   HTTP method shall be GET  |
+|   GETMethodChecking   |   CLOSEDLIST |   [GET,POST] |   HTTP method shall be GET  |
 |   HTTP1VersionChecking   |   FIXEDVALUE  |   HTTP/1.1 |   The HTTP version shall be HTTP/1.1  |
 |   URIRegexChecking   |   REGEX   |   `^(\S)+\/FHIR-Resource$` |   URI path of the request shall be followed by the mCSD resource  |
 |   HostChecking   |   REGEX   |   `^(http[s]?:\/\/)?[a-zA-Z0-9.\-\/]+(\:(\d)+)?$` |   Host Shall be a server name  |
 |   Authorization_parameter_presence   |   OCCURRENCE   |   1..1 |   The Authorization parameter is mandatory  |
 |   Authorization_parameter_value   |   REGEX   |   `^Bearer\\ [-a-zA-Z0-9._~+\\/]+=*$` |   Authorization parameter's value SHALL be Bearer, followed by the token.  |
 |   traceparent_parameter_presence   |   OCCURRENCE   |   1..1 |   The traceparent parameter is mandatory in the HTTP header|
-|   traceparent_parameter_value   |   REGEX   |   `^(?!f{2})([\da-f]{2})-(?!f{32})([\da-f]{32})-(?!f{16})([\da-f]{16})-(?!f{2})([\da-f]{2})$` |   traceparent parameter's value SHALL be as defined in fhir.ch, section [tracecontext](https://fhir.ch/ig/ch-epr-mhealth/tracecontext.html). |
+|   traceparent_parameter_value   |   REGEX   |   `^(?!f{2})([\da-f]{2})-(?!0{32})([\da-f]{32})-(?!0{16})([\da-f]{16})-([\da-f]{2})$` |   traceparent parameter's value SHALL be as defined in fhir.ch, section [tracecontext](https://fhir.ch/ig/ch-epr-mhealth/tracecontext.html). |
 |   _id_parameter_presence   |   OCCURENCE   | 0..1 |   _id parameter can be used only once. |
 |   _id_parameter_value   |   REGEX   |   `^\S+$` |   _id parameter is a token.  |
 |   _lastUpdated_parameter_presence   |   OCCURENCE   | 0..1 |   _lastUpdated parameter can be used only once. |
@@ -73,4 +73,13 @@ date: 2023-03-14
 |   speciality_parameter_presence   | OCCURENCE   | 0..1 |   speciality parameter can be used only once. |
 |   speciality_parameter_value   |   REGEX |  `^\S+$` |  speciality parameter is a token.|
 |   _include__parameter_presence   | OCCURENCE   | 0..1 |   _include parameter can be used only once. |
-|   _include_parameter_value   |   REGEX |  `^.+$` |  _include parameter is a string.|
\ No newline at end of file
+|   _include_parameter_value   |   REGEX |  `^.+$` |  _include parameter is a string.|
+
+## Behaviour of simulators using this HTTP Validation profile
+In case of error response from HTTP Validator, simulators shall sent these HTTP error codes :
+|   Assertion's id  |   HTTP error code  |
+|---    |---    |
+|   GETMethodChecking   | 404 |
+|   Authorization_parameter_presence   | 401 |
+|   Authorization_parameter_presence   | 401 |
+|   All other assertions (default)   | 400 |
\ No newline at end of file
-- 
GitLab