# HG changeset patch # User Alain Mazy # Date 1748860125 -7200 # Node ID 73e9d9248cf32da4afc9923e7d50c5ea9c882316 # Parent 724eda38d9902f84aed9ddc3b4f2bd3b5b90b82f IsProtected diff -r 724eda38d990 -r 73e9d9248cf3 NEWS --- a/NEWS Mon Jun 02 11:33:54 2025 +0200 +++ b/NEWS Mon Jun 02 12:28:45 2025 +0200 @@ -22,6 +22,15 @@ "RejectedSopClasses" spelling. +REST API +-------- + +* If the index database provides the "HasExtendedFind" primitive, the "ResponseContent" option in + "/tools/find" now allows to specify "IsProtected" to retrieve the "IsProtected" status of a + patient resource. + + + Version 1.12.7 (2025-04-07) =========================== diff -r 724eda38d990 -r 73e9d9248cf3 OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp Mon Jun 02 11:33:54 2025 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp Mon Jun 02 12:28:45 2025 +0200 @@ -705,8 +705,8 @@ { call.GetDocumentation().SetHttpGetArgument(GET_RESPONSE_CONTENT, RestApiCallDocumentation::Type_String, "Defines the content of response for each returned resource. Allowed values are `MainDicomTags`, " - "`Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `Attachments`. If not specified, Orthanc " - "will return `MainDicomTags`, `Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`." + "`Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `IsProtected`, `Attachments`. If not specified, Orthanc " + "will return `MainDicomTags`, `Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `IsProtected`." "e.g: '" + GET_RESPONSE_CONTENT + "=MainDicomTags;Children " "(new in Orthanc 1.12.5 - overrides `expand`)", false); @@ -719,8 +719,8 @@ call.GetDocumentation().SetRequestField(POST_RESPONSE_CONTENT, RestApiCallDocumentation::Type_JsonListOfStrings, "Defines the content of response for each returned resource. (this field, if present, overrides the \"Expand\" field). " "Allowed values are `MainDicomTags`, " - "`Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `Attachments`. If not specified, Orthanc " - "will return `MainDicomTags`, `Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`." + "`Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `IsProtected`, `Attachments`. If not specified, Orthanc " + "will return `MainDicomTags`, `Metadata`, `Children`, `Parent`, `Labels`, `Status`, `IsStable`, `IsProtected`." "(new in Orthanc 1.12.5)", false); call.GetDocumentation().SetRequestField(POST_EXPAND, RestApiCallDocumentation::Type_Boolean, diff -r 724eda38d990 -r 73e9d9248cf3 OrthancServer/Sources/ResourceFinder.cpp --- a/OrthancServer/Sources/ResourceFinder.cpp Mon Jun 02 11:33:54 2025 +0200 +++ b/OrthancServer/Sources/ResourceFinder.cpp Mon Jun 02 12:28:45 2025 +0200 @@ -394,6 +394,14 @@ } } + if (responseContent_ & ResponseContentFlags_IsProtected) + { + if (resource.GetLevel() == ResourceType_Patient ) + { + target["IsProtected"] = index.IsProtectedPatient(resource.GetIdentifier()); + } + } + if (responseContent_ & ResponseContentFlags_MainDicomTags) { DicomMap allMainDicomTags; diff -r 724eda38d990 -r 73e9d9248cf3 OrthancServer/Sources/ResourceFinder.h --- a/OrthancServer/Sources/ResourceFinder.h Mon Jun 02 11:33:54 2025 +0200 +++ b/OrthancServer/Sources/ResourceFinder.h Mon Jun 02 12:28:45 2025 +0200 @@ -178,7 +178,7 @@ request_.SetRetrieveAttachments(retrieve); } - // NB: "index" is only used in this method to fill the "IsStable" information + // NB: "index" is used in this method to fill the "IsStable" and "IsProtected" information void Expand(Json::Value& target, const FindResponse::Resource& resource, ServerIndex& index, diff -r 724eda38d990 -r 73e9d9248cf3 OrthancServer/Sources/ServerEnumerations.cpp --- a/OrthancServer/Sources/ServerEnumerations.cpp Mon Jun 02 11:33:54 2025 +0200 +++ b/OrthancServer/Sources/ServerEnumerations.cpp Mon Jun 02 12:28:45 2025 +0200 @@ -655,6 +655,10 @@ { return ResponseContentFlags_IsStable; } + else if (value == "IsProtected") + { + return ResponseContentFlags_IsProtected; + } else { throw OrthancException(ErrorCode_ParameterOutOfRange, diff -r 724eda38d990 -r 73e9d9248cf3 OrthancServer/Sources/ServerEnumerations.h --- a/OrthancServer/Sources/ServerEnumerations.h Mon Jun 02 11:33:54 2025 +0200 +++ b/OrthancServer/Sources/ServerEnumerations.h Mon Jun 02 12:28:45 2025 +0200 @@ -136,6 +136,7 @@ ResponseContentFlags_Children = (1 << 10), ResponseContentFlags_Labels = (1 << 11), ResponseContentFlags_IsStable = (1 << 12), + ResponseContentFlags_IsProtected = (1 << 13), ResponseContentFlags_INTERNAL_CountResources = (1 << 30), @@ -150,7 +151,8 @@ ResponseContentFlags_Parent | ResponseContentFlags_Children | ResponseContentFlags_Labels | - ResponseContentFlags_IsStable), // equivalent to "Expand": true + ResponseContentFlags_IsStable | + ResponseContentFlags_IsProtected), // equivalent to "Expand": true ResponseContentFlags_Default = (ResponseContentFlags_ID | ResponseContentFlags_Type |