diff --git a/EHS/CH-MHD/CH_ITI-65-ProvideDocumentBundle-PostRequest-ValidationProfile.json b/EHS/CH-MHD/CH_ITI-65-ProvideDocumentBundle-PostRequest-ValidationProfile.json new file mode 100644 index 0000000000000000000000000000000000000000..6127cb178ad1dda5af9a09c5416056c89c34eec9 --- /dev/null +++ b/EHS/CH-MHD/CH_ITI-65-ProvideDocumentBundle-PostRequest-ValidationProfile.json @@ -0,0 +1,147 @@ +{ + "profileType": "HTTPREQUEST", + "id": "CH_ITI-65-ProvideDocumentBundle_POST_MHD_Request", + "name": "CH_ITI-65_ProvideDocumentBundle_HTTP_POST_Request", + "description": "Validation Profile for validating a POST ITI-65 Feed.", + "context": "EPR", + "assertions": [ + { + "selector": "request.method", + "id": "MethodChecking", + "description": "HTTP method shall be POST", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedvalue": "POST" + } + ] + }, + { + "selector": "request.version", + "id": "HTTP1VersionChecking", + "description": "The HTTP version shall be HTTP/1.1", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedValue": "HTTP/1.1" + } + ] + }, + { + "selector": "request.uri.path", + "id": "URIRegexChecking", + "description": "URI path of the request shall be made of non space caracters", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(\\S)$" + } + ] + }, + { + "selector": "request.headers('Host').values", + "id": "HostChecking", + "description": "Host Shall be a server name.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(http[s]?:\\/\\/)?[a-zA-Z0-9.\\-\\/]+(:(\\d)+)?$" + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_presence", + "description": "The Authorization parameter is mandatory.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_value", + "description": "Authorization parameter's value SHALL be Bearer, followed by the token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^Bearer\\ [-a-zA-Z0-9._~+\\/]+=*$" + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_presence", + "description": "The traceparent parameter is mandatory in the HTTP header.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_value", + "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", + "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$" + } + ] + }, + { + "selector": "request.uri.queryParams('_format').values", + "id": "_format_parameter_presence", + "description": "_format parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('_format').values", + "id": "_format_parameter_value", + "description": "_format parameter's value shall be either json or xml.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('_format').values.size() > 0", + "checks": [ + { + "type": "CLOSEDLIST", + "values": [ + "json", + "xml" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/EHS/CH-MHD/CH_ITI-66-FindDocumentLists-GetPostRequest-ValidationProfile.json b/EHS/CH-MHD/CH_ITI-66-FindDocumentLists-GetPostRequest-ValidationProfile.json new file mode 100644 index 0000000000000000000000000000000000000000..e05223a015bce0e33d8e98036f174f6adcb93caa --- /dev/null +++ b/EHS/CH-MHD/CH_ITI-66-FindDocumentLists-GetPostRequest-ValidationProfile.json @@ -0,0 +1,398 @@ +{ + "profileType": "HTTPREQUEST", + "id": "CH_ITI-66-FindDocumentLists-GET_MHD_Request", + "name": "CH_ITI-66-FindDocumentLists_HTTP_GET_Request", + "description": "Validation Profile for validating a CH:MHD ITI-66 query.", + "context": "EPR", + "assertions": [ + { + "selector": "request.method", + "id": "MethodChecking", + "description": "HTTP method shall be GET or POST", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "CLOSEDLIST", + "values": [ + "GET", + "POST" + ] + } + ] + }, + { + "selector": "request.version", + "id": "HTTP1VersionChecking", + "description": "The HTTP version shall be HTTP/1.1", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedValue": "HTTP/1.1" + } + ] + }, + { + "selector": "request.uri.path", + "id": "URIRegexChecking", + "description": "URI path of the request shall be followed by the MHD resource", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(\\S)+List$" + } + ] + }, + { + "selector": "request.headers('Host').values", + "id": "HostChecking", + "description": "Host Shall be a server name.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(http[s]?:\\/\\/)?[a-zA-Z0-9.\\-\\/]+(:(\\d)+)?$" + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_presence", + "description": "The Authorization parameter is mandatory.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_value", + "description": "Authorization parameter's value SHALL be Bearer, followed by the token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^Bearer\\ [-a-zA-Z0-9._~+\\/]+=*$" + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_presence", + "description": "The traceparent parameter is mandatory in the HTTP header.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_value", + "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", + "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$" + } + ] + }, + { + "selector": "request.uri.queryParams('code').values", + "id": "code_parameter_presence", + "description": "The Document Consumer shall include search parameter code.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('code').values", + "id": "code_parameter_value", + "description": "code parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('date').values", + "id": "date", + "description": "date parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('date').values", + "id": "date_parameter_value", + "description": "date parameter is made of a date eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap).", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('date').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^(eq|ne|lt|gt|ge|le|sa|eb|ap)?[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|1\\d|2[0-8]|3[01])$" + } + ] + }, + { + "selector": "request.uri.queryParams('designationType').values", + "id": "designationType_parameter_presence", + "description": "designationType parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('designationType').values", + "id": "designationType_parameter_value", + "description": "designationType parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('designationType').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('identifier').values", + "id": "identifier_parameter_presence", + "description": "identifier parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('identifier').values", + "id": "identifier_parameter_value", + "description": "identifier parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('identifier').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('patient').values", + "id": "patient_parameter_presence", + "description": "patient parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('patient').values", + "id": "patient_parameter_value", + "description": "patient parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('patient').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('patient.identifier').values", + "id": "patient.identifier_parameter_presence", + "description": "patient.identifier parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('patient.identifier').values", + "id": "patient.identifier_parameter_value", + "description": "patient.identifier parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('patient.identifier').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('source.given').values", + "id": "source.given_parameter_presence", + "description": "source.given parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('source.given').values", + "id": "source.given_parameter_value", + "description": "source.given parameter is made of a string.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('source.given').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^[\\s\\S]+$" + } + ] + }, + { + "selector": "request.uri.queryParams('source.family').values", + "id": "source.family_parameter_presence", + "description": "source.family parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('source.family').values", + "id": "source.family_parameter_value", + "description": "source.family parameter is made of a string.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('source.family').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^[\\s\\S]+$" + } + ] + }, + { + "selector": "request.uri.queryParams('sourceId').values", + "id": "sourceId_parameter_presence", + "description": "sourceId parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('sourceId').values", + "id": "sourceId_parameter_value", + "description": "sourceId parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('sourceId').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('status').values", + "id": "status_parameter_presence", + "description": "The Document Consumer shall include search status.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('status').values", + "id": "status_parameter_value", + "description": "status parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('status').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + } + ] +} \ No newline at end of file diff --git a/EHS/CH-MHD/CH_ITI-67-FindDocumentReferences-GetPostRequest-ValidationProfile.json b/EHS/CH-MHD/CH_ITI-67-FindDocumentReferences-GetPostRequest-ValidationProfile.json new file mode 100644 index 0000000000000000000000000000000000000000..8ed97a2cb770d026194064a1ff88a9c57da96a29 --- /dev/null +++ b/EHS/CH-MHD/CH_ITI-67-FindDocumentReferences-GetPostRequest-ValidationProfile.json @@ -0,0 +1,565 @@ +{ + "profileType": "HTTPREQUEST", + "id": "CH_ITI-67-FindDocumentReferences-GET_MHD_Request", + "name": "CH_ITI-67-FindDocumentReferences_HTTP_GET_Request", + "description": "Validation Profile for validating a CH:MHD ITI-67 query.", + "context": "EPR", + "assertions": [ + { + "selector": "request.method", + "id": "MethodChecking", + "description": "HTTP method shall be GET or POST", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "CLOSEDLIST", + "values": [ + "GET", + "POST" + ] + } + ] + }, + { + "selector": "request.version", + "id": "HTTP1VersionChecking", + "description": "The HTTP version shall be HTTP/1.1", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedValue": "HTTP/1.1" + } + ] + }, + { + "selector": "request.uri.path", + "id": "URIRegexChecking", + "description": "URI path of the request shall be followed by the MHD resource", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(\\S)+DocumentReference$" + } + ] + }, + { + "selector": "request.headers('Host').values", + "id": "HostChecking", + "description": "Host Shall be a server name.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(http[s]?:\\/\\/)?[a-zA-Z0-9.\\-\\/]+(:(\\d)+)?$" + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_presence", + "description": "The Authorization parameter is mandatory.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_value", + "description": "Authorization parameter's value SHALL be Bearer, followed by the token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^Bearer\\ [-a-zA-Z0-9._~+\\/]+=*$" + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_presence", + "description": "The traceparent parameter is mandatory in the HTTP header.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_value", + "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", + "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$" + } + ] + }, + { + "selector": "request.uri.queryParams('author.given').values", + "id": "author.given_parameter_presence", + "description": "author.given parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('author.given').values", + "id": "author.given_parameter_value", + "description": "author.given parameter is a string.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^[\\s\\S]+$" + } + ] + }, + { + "selector": "request.uri.queryParams('author.family').values", + "id": "author.family_parameter_presence", + "description": "author.family parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('author.family').values", + "id": "author.family_parameter_value", + "description": "author.family parameter is a string.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^[\\s\\S]+$" + } + ] + }, + { + "selector": "request.uri.queryParams('category').values", + "id": "category_parameter_presence", + "description": "category parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('category').values", + "id": "category_parameter_value", + "description": "category parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('category').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('creation').values", + "id": "creation", + "description": "creation parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('creation').values", + "id": "creation_parameter_value", + "description": "creation parameter is a dateTime eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap).", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('creation').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^(eq|ne|lt|gt|ge|le|sa|eb|ap)?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]{1,9})?)?)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)?)?)?$" + } + ] + }, + { + "selector": "request.uri.queryParams('date').values", + "id": "date", + "description": "date parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('date').values", + "id": "date_parameter_value", + "description": "date parameter is made of a date eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap).", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('date').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^(eq|ne|lt|gt|ge|le|sa|eb|ap)?[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|1\\d|2[0-8]|3[01])$" + } + ] + }, + { + "selector": "request.uri.queryParams('event').values", + "id": "event_parameter_presence", + "description": "event parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('event').values", + "id": "event_parameter_value", + "description": "event parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('event').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('facility').values", + "id": "facility_parameter_presence", + "description": "facility parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('facility').values", + "id": "facility_parameter_value", + "description": "facility parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('facility').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('format').values", + "id": "format_parameter_presence", + "description": "format parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('format').values", + "id": "format_parameter_value", + "description": "format parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('format').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('patient').values", + "id": "patient_parameter_presence", + "description": "patient parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('patient').values", + "id": "patient_parameter_value", + "description": "patient parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('patient').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('patient.identifier').values", + "id": "patient.identifier_parameter_presence", + "description": "patient.identifier parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('patient.identifier').values", + "id": "patient.identifier_parameter_value", + "description": "patient.identifier parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('patient.identifier').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('period').values", + "id": "period", + "description": "period parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('period').values", + "id": "period_parameter_value", + "description": "period parameter is made of a date eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap).", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('period').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^(eq|ne|lt|gt|ge|le|sa|eb|ap)?[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|1\\d|2[0-8]|3[01])$" + } + ] + }, + { + "selector": "request.uri.queryParams('related').values", + "id": "related_parameter_presence", + "description": "related parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('related').values", + "id": "related_parameter_value", + "description": "related parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('related').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('security-label').values", + "id": "security-label_parameter_presence", + "description": "security-label parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('security-label').values", + "id": "security-label_parameter_value", + "description": "security-label parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('security-label').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('setting').values", + "id": "setting_parameter_presence", + "description": "setting parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('setting').values", + "id": "setting_parameter_value", + "description": "setting parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('setting').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('status').values", + "id": "status_parameter_presence", + "description": "The Document Consumer shall include search status.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('status').values", + "id": "status_parameter_value", + "description": "status parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('status').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + }, + { + "selector": "request.uri.queryParams('type').values", + "id": "type_parameter_presence", + "description": "type parameter can be used only once.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.uri.queryParams('type').values", + "id": "type_parameter_value", + "description": "type parameter is a token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "applyIf": "request.uri.queryParams('type').values.size() > 0", + "checks": [ + { + "type": "REGEX", + "regex": "^\\S+$" + } + ] + } + ] +} \ No newline at end of file diff --git a/EHS/CH-MHD/CH_ITI-68-Retrieve Document-ValidationProfile.json b/EHS/CH-MHD/CH_ITI-68-Retrieve Document-ValidationProfile.json new file mode 100644 index 0000000000000000000000000000000000000000..675d598f06106e159c16460719aed492ccfba82d --- /dev/null +++ b/EHS/CH-MHD/CH_ITI-68-Retrieve Document-ValidationProfile.json @@ -0,0 +1,116 @@ +{ + "profileType": "HTTPREQUEST", + "id": "CH_ITI-68-RetrieveDocument-GET_MHD_Request", + "name": "CH_ITI-68-RetrieveDocument_HTTP_GET_Request", + "description": "Validation Profile for validating a MHD ITI-68 Retrieve request.", + "context": "EPR", + "assertions": [ + { + "selector": "request.method", + "id": "MethodChecking", + "description": "HTTP method shall be GET", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedValue": "GET" + } + ] + }, + { + "selector": "request.version", + "id": "HTTP1VersionChecking", + "description": "The HTTP version shall be HTTP/1.1", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "FIXEDVALUE", + "fixedValue": "HTTP/1.1" + } + ] + }, + { + "selector": "request.uri.path", + "id": "URIRegexChecking", + "description": "URI path of the request shall be directly followed by the document id.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(\\S)+\/(\\S)+$" + } + ] + }, + { + "selector": "request.headers('Host').values", + "id": "HostChecking", + "description": "Host Shall be a server name; Regex: ^(http[s]?:\\/\\/)?[a-zA-Z0-9.\\-\\/]+(:(\\d)+)?$", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^(http[s]?:\\/\\/)?[a-zA-Z0-9.\\-\\/]+(:(\\d)+)?$" + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_presence", + "description": "The Authorization parameter is mandatory.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 1, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('Authorization').values", + "id": "Authorization_parameter_value", + "description": "Authorization parameter's value SHALL be Bearer, followed by the token.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "REGEX", + "regex": "^Bearer\\ [-a-zA-Z0-9._~+\\/]+=*$" + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_presence", + "description": "The traceparent parameter is mandatory in the HTTP header.", + "requirementPriority": "MANDATORY", + "checksComposition": "oneOf", + "checks": [ + { + "type": "OCCURRENCE", + "minOccurrence": 0, + "maxOccurrence": 1 + } + ] + }, + { + "selector": "request.headers('traceparent').values", + "id": "traceparent_parameter_value", + "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", + "regex": "^(?!f{2})([\\da-f]{2})-(?!0{32})([\\da-f]{32})-(?!0{16})([\\da-f]{16})-([\\da-f]{2})$" + } + ] + } + ] +} \ No newline at end of file diff --git a/EHS/CH-MHD/README.md b/EHS/CH-MHD/README.md index 1e23364fb5614d1733b50113fee1aae2065d15fb..220c084c3f62bfd2557500918dbde1b6a28a5a88 100644 --- a/EHS/CH-MHD/README.md +++ b/EHS/CH-MHD/README.md @@ -12,7 +12,7 @@ These validation profiles' documentation reference: - [FHIR's Datatypes](https://build.fhir.org/datatypes.html) - [String type's modifiers](https://build.fhir.org/search.html#modifiers) -## ITI-65 Provide Document Bundle +## ITI-65 Provide Document Bundle assertions | id | Check's type | Value | Description | |--- |--- |--- |--- | @@ -28,7 +28,7 @@ These validation profiles' documentation reference: | _format_parameter_value | CLOSEDLIST | [json,xml] | _format parameter's value shall be either json or xml. | -## ITI-66 Find Document Lists +## ITI-66 Find Document Lists assertions | id | Check's type | Value | Description | |--- |--- |--- |--- | @@ -48,7 +48,7 @@ These validation profiles' documentation reference: | designationType_parameter_value | REGEX | `^\S+$` | designationType parameter is a token. | | identifier_parameter_presence | OCCURRENCE | 0..1 | identifier parameter can be used only once. | | identifier_parameter_value | REGEX | `^\S+$` | identifier parameter is a token. | -| patient_or_patient.identifier_presence | REGEX | \bpatient(\.identifier)?\b | The Document Consumer shall include search parameter patient or patient.identifier. | +| patient_or_patient.identifier_presence[^1]. | REGEX | \bpatient(\.identifier)?\b | The Document Consumer shall include search parameter patient or patient.identifier. | | patient_parameter_presence | OCCURRENCE | 0..1 | patient parameter can be used only once. | | patient_parameter_value | REGEX | `^\S+$` | patient parameter is a token. | | patient.identifier_parameter_presence | OCCURRENCE | 0..1 | patient.identifier parameter can be used only once. | @@ -62,7 +62,9 @@ These validation profiles' documentation reference: | status_parameter_presence | OCCURRENCE | 1..1 | The Document Consumer shall include search status. | | status_parameter_value | REGEX | `^\S+$` | status parameter is a token. | -## ITI-67 Find Document References +[^1]: Can't be check with current HTTP Validator; see issue: https://gazelle.ihe.net/jira/browse/HTTP-57 + +## ITI-67 Find Document References assertions | id | Check's type | Value | Description | |--- |--- |--- |--- | @@ -81,8 +83,7 @@ These validation profiles' documentation reference: | category_parameter_presence | OCCURRENCE | 0..1 | category parameter can be used only once. | | category_parameter_value | REGEX | `^\S+$` | category parameter is a token. | | creation_parameter_presence | OCCURRENCE | 0..1 | creation parameter can be used only once. | -| creation_parameter_value | REGEX | `^(eq\|ne\|lt\|gt\|ge\|le\|sa\|eb\|ap)?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]{1,9})?)?)?(Z|(\+|-)((0[0-9]|1[0-3]):[0- -5][0-9]|14:00)?)?)?$` | creation parameter is a dateTime. | +| creation_parameter_value | REGEX | `^(eq\|ne\|lt\|gt\|ge\|le\|sa\|eb\|ap)?([0-9]([0-9]([0-9][1-9]\|[1-9]0)\|[1-9]00)\|[1-9]000)(-(0[1-9]\|1[0-2])(-(0[1-9]\|[1-2][0-9]\|3[0-1])(T([01][0-9]\|2[0-3]):[0-5][0-9]:([0-5][0-9]\|60)(\.[0-9]{1,9})?)?)?(Z\|(\+\|-)((0[0-9]\|1[0-3]):[0-5][0-9]\|14:00)?)?)?$` | creation parameter is a dateTime eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap). | | date_parameter_presence | OCCURENCE | 0..1 | date parameter can be used only once. | | date_parameter_value | REGEX | `^(eq\|ne\|lt\|gt\|ge\|le\|sa\|eb\|ap)?[0-9]{4}-(0[1-9]\|1[0-2])-(0[1-9]\|1\d\|2[0-8]\|3[01])$` | date parameter is made of a date eventually preceded by a modifier (eq,ne,lt,gt,ge,le,sa,eb or ap). | | event_parameter_presence | OCCURRENCE | 0..1 | event parameter can be used only once. | @@ -116,13 +117,13 @@ These validation profiles' documentation reference: | id | Check's type | Value | Description | |--- |--- |--- |--- | -| GETMethodChecking | FIXEDVALUE | GET | HTTP method shall be GET | +| MethodChecking | FIXEDVALUE | GET | HTTP method shall be GET | | HTTP1VersionChecking | FIXEDVALUE | HTTP/1.1 | The HTTP version shall be HTTP/1.1 | -| URIRegexChecking | REGEX | `^(\S)+\/Document\/(\S)+$` | URI path of the request shall be followed by the MHD resource | +| URIRegexChecking | REGEX | `^(\S)+\/(\S)+$` | URI path of the request shall be directly followed by the document id. | | 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_presence | OCCURRENCE | 0..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). | ## Behaviour of simulators using this HTTP Validation profile diff --git a/EHS/samples/CH-MHD/CH-MHD - 027 - valid - ITI-68 - GET.txt b/EHS/samples/CH-MHD/CH-MHD - 027 - valid - ITI-68 - GET.txt index 520b1d2a34f3775e1c6653b68c672e8e47baa68a..7e4f1a92364963b79216ffb4a44142ae25cf46b7 100644 --- a/EHS/samples/CH-MHD/CH-MHD - 027 - valid - ITI-68 - GET.txt +++ b/EHS/samples/CH-MHD/CH-MHD - 027 - valid - ITI-68 - GET.txt @@ -1,4 +1,4 @@ -GET DocumentRecipient/1 HTTP/1.1 +GET DocumentResponder/1 HTTP/1.1 Accept: application/fhir+json Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJnVmd6VWtRZEtwZHVMbmF4bThKQy1JYTh0VUdNV0J1TTJZT2R3akthcEdzIn0.eyJleHAiOjE3MDgzNDg0ODUsImlhdCI6MTcwODM0ODE4NSwiYXV0aF90aW1lIjoxNzA4MzQ4MTQzLCJqdGkiOiI5OGZjZDFiNy0wZGE5LTRkZGQtODUwNy1hM2I1YmU3NmY0ZmIiLCJpc3MiOiJodHRwczovL2VoZWFsdGhzdWlzc2UuaWhlLWV1cm9wZS5uZXQvaXVhLXNzby9yZWFsbXMvY2gtaXVhIiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImFjNGZkNjI2LWNiZGYtNGIzMC1hOTNhLTc0YTM2YWQyM2QwYiIsInR5cCI6IkJlYXJlciIsImF6cCI6ImNoLWl1YS1jbGllbnQiLCJzZXNzaW9uX3N0YXRlIjoiYzUyMTE2NjItY2VhNy00ZmFmLWFkZjktNDNiNTE2MGNjYjUwIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyIvKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsiZGVmYXVsdC1yb2xlcy1jaC1pdWEiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwdXJwb3NlX29mX3VzZT11cm46b2lkOjIuMTYuNzU2LjUuMzAuMS4xMjcuMy4xMC41fE5PUk0gcHJvZmlsZSBsYXVuY2ggZW1haWwiLCJzaWQiOiJjNTIxMTY2Mi1jZWE3LTRmYWYtYWRmOS00M2I1MTYwY2NiNTAiLCJleHRlbnNpb25zIjp7ImNoX2VwciI6eyJ1c2VyX2lkX3F1YWxpZmllciI6InVybjpnczE6Z2xuIiwidXNlcl9pZCI6Ijc2MDEwMDI0NjczNzMifSwiY2hfaXVhIjp7ImxhdW5jaCI6ImxhdW5jaCJ9LCJpaGVfaXVhIjp7InB1cnBvc2Vfb2ZfdXNlIjp7ImNvZGUiOiJOT1JNIiwic3lzdGVtIjoidXJuOm9pZDoyLjE2Ljc1Ni41LjMwLjEuMTI3LjMuMTAuNSJ9fX0sImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwibmFtZSI6InJyZXlub2xkcyBSZXlub2xkcyIsInByZWZlcnJlZF91c2VybmFtZSI6InJyZXlub2xkcyIsImdpdmVuX25hbWUiOiJycmV5bm9sZHMiLCJmYW1pbHlfbmFtZSI6IlJleW5vbGRzIn0.mT9ZTGNqTfsMBxoyGLaQlUr9PVcFItvlKmZxjY4_OAHqi4nE82S5n0mE4iy_5YL_sbYtNODI1L_LH6keBTCSbSOY5REkp_NLm4QLzdX4ynJ7Y_nMoD5H6TFqJTrllKVJ5IKtXhWv9bLQK35PLLPeNMZH4yl3ChlOlx0IH-zqHEPcOV69kN1vC7_Jjj0vx3d0RFvR_0sbfG3XnSiO3fpwwj2xYgRfZkfJqTuZ5404j9nu8TiPHtCRqQ_EPtEirUTG1ClX1DahJRKB-jwLHThxkKooUxsRAQZVhqayhLMV8sxwNkeHnNemhqreOkeDELxn2ZC-VOQLe9WRsX37QagO1g traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-00