diff --git a/app/Http/Controllers/Api/V1/DatasetController.php b/app/Http/Controllers/Api/V1/DatasetController.php index 51e2913b8..8813df17d 100644 --- a/app/Http/Controllers/Api/V1/DatasetController.php +++ b/app/Http/Controllers/Api/V1/DatasetController.php @@ -599,6 +599,7 @@ public function store(CreateDataset $request): JsonResponse // Ensure title is present for creating a dataset if (empty($input['metadata']['metadata']['summary']['title'])) { return response()->json([ + 'mmmm' => $input['metadata'], 'message' => 'Title is required to save a dataset', ], 400); } diff --git a/app/Http/Controllers/Api/V1/TestController.php b/app/Http/Controllers/Api/V1/TestController.php index 3e09612a4..746cadd6b 100644 --- a/app/Http/Controllers/Api/V1/TestController.php +++ b/app/Http/Controllers/Api/V1/TestController.php @@ -64,4 +64,509 @@ public function testGCPLogger(Request $request): JsonResponse return response()->json(['status' => 'success']); } + + public function testListDatasets(Request $request): JsonResponse + { + return response()->json([ + "total" => 3, + "items" => [ + [ + "persistentId" => "242c84be-a866-ac0c-0000-000000001bbd", + "name" => "Kent Integrated Dataset - GP Consultations", + "description" => "Primary Care Consultations information, recording the intereactions that patients with medical staff at GP practices", + "version" => "1.0.0", + "self" => "https://nhse-ics-kms-uat5-ui.metadata.works/api/federation/dataset/7101", + "source" => "", + "@schema" => "https://hdruk.github.io/schemata/schema/dataset/2.1.0/dataset.schema.json", + "issued" => "2024-03-09T23:22:05+00:00", + "modified" => "2024-07-03T09:54:34+00:00" + ], + [ + "persistentId" => "242c84be-a866-ac0c-0000-000000001bbe", + "name" => "Kent Integrated Dataset - GP Event", + "description" => "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "version" => "1.0.0", + "self" => "https://nhse-ics-kms-uat5-ui.metadata.works/api/federation/dataset/7102", + "source" => "", + "@schema" => "https://hdruk.github.io/schemata/schema/dataset/2.1.0/dataset.schema.json", + "issued" => "2024-03-09T23:22:07+00:00", + "modified" => "2024-07-03T09:55:18+00:00" + ], + [ + "persistentId" => "242c84be-a866-ac0c-0000-000000002564", + "name" => "Sample Dataset", + "version" => "1.0.0", + "self" => "https://nhse-ics-kms-uat5-ui.metadata.works/api/federation/dataset/9572", + "source" => "", + "@schema" => "https://hdruk.github.io/schemata/schema/dataset/2.1.0/dataset.schema.json", + "issued" => "2024-01-29T17:01:20+00:00", + "modified" => "2024-11-26T09:37:22+00:00" + ] + ] + ]); + } + + public function testListDatasetId(Request $request, $id): JsonResponse + { + if ($id === '242c84be-a866-ac0c-0000-000000001bbd') { + return response()->json($this->testOne()); + } + + if ($id === '242c84be-a866-ac0c-0000-000000001bbe') { + return response()->json($this->testTwo()); + } + + if ($id === '242c84be-a866-ac0c-0000-000000002564') { + return response()->json($this->testTwo()); + } + } + + public function testThree() + { + return [ + "identifier" => "242c84be-a866-ac0c-0000-000000000002", + "version" => "1.0.0", + "revisions" => [ + [ + "version" => "1.0.0", + "url" => "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=9572" + ] + ], + "issued" => "2024-01-29T17:01:20+00:00", + "modified" => "2024-11-26T09:37:22+00:00", + "summary" => [ + "title" => "Sample Dataset", + "abstract" => "Lorem ipsum dolor sit amet.", + "publisher" => [ + "name" => "Lorem", + "contactPoint" => [ + "test@test.com" + ], + "memberOf" => "OTHER" + ], + "contactPoint" => "jonny@metadataworks.co.uk", + "keywords" => ["Lorem","Ipsum"] + ], + "accessibility" => [ + "access" => [ + "accessRights" => [], + "jurisdiction" => [ + "GB-ENG" + ], + "dataController" => " " + ] + ], + "observations" => [] + ]; + } + + public function testTwo() + { + return [ + "identifier" => "242c84be-a866-ac0c-0000-000000001bbe", + "version" => "1.0.0", + "revisions" => [ + [ + "version" => "1.0.0", + "url" => "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=7102" + ] + ], + "issued" => "2024-03-09T23:22:07+00:00", + "modified" => "2024-07-03T09:55:18+00:00", + "summary" => [ + "title" => "Kent Integrated Dataset - GP Event", + "abstract" => "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "publisher" => [ + "name" => "Kent & Medway Data Warehouse", + "logo" => "https://www.kentandmedway.icb.nhs.uk/application/files/cache/thumbnails/b9a92ca7b10d21ae1cdf056d95e99659.png", + "description" => "https://www.kentandmedway.icb.nhs.uk/about-us", + "contactPoint" => [ + "kmicb.bi@nhs.net" + ], + "memberOf" => "OTHER" + ], + "contactPoint" => "kmicb.bi@nhs.net", + "keywords" => ["General practitioner", "Event", "GP ", "HDRUK", "Primary care"], + "doiName" => "10.81022/wfv3-tz28" + ], + "documentation" => [ + "description" => "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "isPartOf" => ["Primary Care Data"] + ], + "coverage" => [ + "spatial" => "Kent and Medway", + "typicalAgeRange" => "0-120", + "physicalSampleAvailability" => ["NOT AVAILABLE"], + "followup" => "UNKNOWN" + ], + "provenance" => [ + "origin" => [ + "purpose" => ["CARE"], + "source" => ["EPR"], + "collectionSituation" => ["PRIMARY CARE"] + ], + "temporal" => [ + "accrualPeriodicity" => "STATIC", + "distributionReleaseDate" => "2019-06-24", + "startDate" => "1901-01-01", + "endDate" => "2019-06-24", + "timeLag" => "NOT APPLICABLE" + ] + ], + "accessibility" => [ + "usage" => [ + "dataUseLimitation" => ["RESEARCH SPECIFIC RESTRICTIONS"], + "dataUseRequirements" => [ + "ETHICS APPROVAL REQUIRED", + "GEOGRAPHICAL RESTRICTIONS", + "NOT FOR PROFIT USE", + "PROJECT SPECIFIC RESTRICTIONS", + "TIME LIMIT ON USE", + "USER SPECIFIC RESTRICTION" + ], + "resourceCreator" => ["Kent and Mewday ICB", "Kent and Medway Data Warehouse"] + ], + "access" => [ + "accessRights" => [], + "accessService" => " ", + "accessRequestCost" => "To be agreed per project by SDE program", + "deliveryLeadTime" => "1-2 MONTHS", + "jurisdiction" => ["GB-ENG"], + "dataController" => "Kent and Medway ICB", + "dataProcessor" => "Kent and Medway Data Warehouse" + ], + "formatAndStandards" => [ + "vocabularyEncodingScheme" => [ + "READ", + "NHS NATIONAL CODES", + "ODS" + ], + "conformsTo" => [ + "LOCAL" + ], + "language" => [ + "en" + ], + "format" => [ + "Text" + ] + ] + ], + "observations" => [ + [ + "observedNode" => "PERSONS", + "measuredValue" => 1756178, + "disambiguatingDescription" => " ", + "observationDate" => "2019-06-24", + "measuredProperty" => "COUNT" + ], + [ + "observedNode" => "EVENTS", + "measuredValue" => 732236154, + "disambiguatingDescription" => " ", + "observationDate" => "2019-06-24", + "measuredProperty" => "COUNT" + ] + ], + "structuralMetadata" => [ + [ + "name" => "GP_Event", + "description" => "Primary Care Event Table", + "elements" => [ + [ + "name" => "Unique_ID", + "dataType" => "String", + "description" => "Unique reference to the record", + "sensitive" => false + ], + [ + "name" => "Commissioner_Code", + "dataType" => "String", + "description" => "Commissioner for the event", + "sensitive" => false + ], + [ + "name" => "Practice_Code", + "dataType" => "String", + "description" => "Code for GP practice that is as at the activity date", + "sensitive" => false + ], + [ + "name" => "Age ", + "dataType" => "Integer", + "description" => "Age of patient at activity date", + "sensitive" => false + ], + [ + "name" => "Sex ", + "dataType" => "String", + "description" => "Sex of patient at activity date", + "sensitive" => false + ], + [ + "name" => "Event_Read_Code", + "dataType" => "String", + "description" => "Read code of the event", + "sensitive" => false + ], + [ + "name" => "Num_Result", + "dataType" => "floating point", + "description" => "Numeric result of the event", + "sensitive" => false + ], + [ + "name" => "Num_Result_2", + "dataType" => "floating point", + "description" => "Second numeric result of the event", + "sensitive" => false + ], + [ + "name" => "Activity_Date", + "dataType" => "date", + "description" => "Date of the event activity", + "sensitive" => false + ], + [ + "name" => "Pseudonymised_NHS_Number", + "dataType" => "String", + "description" => "NHS number of patient, encrypted with 256 bit SHA with salt", + "sensitive" => false + ], + [ + "name" => "Unique_Consultation_ID", + "dataType" => "String", + "description" => "Unique reference to the consultation record", + "sensitive" => false + ], + [ + "name" => "SNOMED_Concept", + "dataType" => "bigint", + "description" => "SNOMED concept of Event (https://www.datadictionary.nhs.uk/data_elements/snomed_ct_code.html)", + "sensitive" => false + ], + [ + "name" => "SNOMED_Description", + "dataType" => "bigint", + "description" => "SNOMED description of Event", + "sensitive" => false + ] + ] + ] + ] + ]; + } + + public function testOne() + { + return [ + "identifier" => "242c84be-a866-ac0c-0000-000000001bbd", + "version" => "1.0.0", + "revisions" => [ + [ + "version" => "1.0.0", + "url" => "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=7101" + ] + ], + "issued" => "2024-03-09T23:22:05+00:00", + "modified" => "2024-07-03T09:54:34+00:00", + "summary" => [ + "title" => "Kent Integrated Dataset - GP Consultations", + "abstract" => "Primary Care Consultations information, recording the intereactions that patients with medical staff at GP practices", + "publisher" => [ + "name" => "Kent & Medway Data Warehouse", + "logo" => "https://www.kentandmedway.icb.nhs.uk/application/files/cache/thumbnails/b9a92ca7b10d21ae1cdf056d95e99659.png", + "description" => "https://www.kentandmedway.icb.nhs.uk/about-us", + "contactPoint" => [ + "kmicb.bi@nhs.net" + ], + "memberOf" => "OTHER" + ], + "contactPoint" => "kmicb.bi@nhs.net", + "keywords" => [ + "General practitioner", + "Consultation", + "GP ", + "Primary care" + ], + "doiName" => "10.81022/kfqp-wq04" + ], + "documentation" => [ + "description" => "Primary Care Consultations information, recording the intereactions that patients with medical staff at GP practices", + "isPartOf" => [ + "Primary Care Data" + ] + ], + "coverage" => [ + "spatial" => "Kent and Medway", + "typicalAgeRange" => "0-120", + "physicalSampleAvailability" => [ + "NOT AVAILABLE" + ], + "followup" => "UNKNOWN" + ], + "provenance" => [ + "origin" => [ + "purpose" => [ + "CARE" + ], + "source" => [ + "EPR" + ], + "collectionSituation" => [ + "PRIMARY CARE" + ] + ], + "temporal" => [ + "accrualPeriodicity" => "STATIC", + "distributionReleaseDate" => "2019-06-24", + "startDate" => "2014-04-01", + "endDate" => "2019-06-24", + "timeLag" => "NOT APPLICABLE" + ] + ], + "accessibility" => [ + "usage" => [ + "dataUseLimitation" => [ + "RESEARCH SPECIFIC RESTRICTIONS" + ], + "dataUseRequirements" => [ + "ETHICS APPROVAL REQUIRED", + "GEOGRAPHICAL RESTRICTIONS", + "NOT FOR PROFIT USE", + "PROJECT SPECIFIC RESTRICTIONS", + "TIME LIMIT ON USE", + "USER SPECIFIC RESTRICTION" + ], + "resourceCreator" => [ + "Kent and Mewday ICB", + "Kent and Medway Data Warehouse" + ] + ], + "access" => [ + "accessRights" => [], + "accessService" => " ", + "accessRequestCost" => "To be agreed per project by SDE program", + "deliveryLeadTime" => "1-2 MONTHS", + "jurisdiction" => [ + "GB-ENG" + ], + "dataController" => "Kent and Medway ICB", + "dataProcessor" => "Kent and Medway Data Warehouse" + ], + "formatAndStandards" => [ + "vocabularyEncodingScheme" => [ + "READ", + "NHS NATIONAL CODES", + "ODS" + ], + "conformsTo" => [ + "LOCAL" + ], + "language" => [ + "en" + ], + "format" => [ + "Text" + ] + ] + ], + "observations" => [ + [ + "observedNode" => "PERSONS", + "measuredValue" => 1350436, + "disambiguatingDescription" => " ", + "observationDate" => "2019-06-24", + "measuredProperty" => "COUNT" + ], + [ + "observedNode" => "EVENTS", + "measuredValue" => 29514552, + "disambiguatingDescription" => " ", + "observationDate" => "2019-06-24", + "measuredProperty" => "COUNT" + ] + ], + "structuralMetadata" => [ + [ + "name" => "GP Consultations", + "description" => "Primary Care Consultations Table", + "elements" => [ + [ + "name" => "Commissioner_Code", + "dataType" => "String", + "description" => "Commissioner for the consultation", + "sensitive" => false + ], + [ + "name" => "Activity_Date", + "dataType" => "date", + "description" => "Date of the activity", + "sensitive" => false + ], + [ + "name" => "Data_Currency", + "dataType" => "String", + "description" => "Consultant or home visit", + "sensitive" => false + ], + [ + "name" => "Current_Practice_Code", + "dataType" => "String", + "description" => "Code for GP practice that is current for the patient from PMI", + "sensitive" => false + ], + [ + "name" => "Practice_Code", + "dataType" => "String", + "description" => "Code for GP practice that is as at the activity date", + "sensitive" => false + ], + [ + "name" => "Consultation_Read_Code", + "dataType" => "String", + "description" => "Read code of the consultation", + "sensitive" => false + ], + [ + "name" => "Sex ", + "dataType" => "String", + "description" => "Sex of patient at activity date", + "sensitive" => false + ], + [ + "name" => "Unique_ID", + "dataType" => "String", + "description" => "Unique reference to the consultation record", + "sensitive" => false + ], + [ + "name" => "Pseudonymised_NHS_Number", + "dataType" => "String", + "description" => "NHS number of patient, encrypted with 256 bit SHA with salt", + "sensitive" => false + ], + [ + "name" => "Staff_Member_Type", + "dataType" => "String", + "description" => "Type of staff member who attended patient", + "sensitive" => false + ], + [ + "name" => "Pseudonymised_Staff_Member", + "dataType" => "String", + "description" => "ID of staff member, encrypted with 256 bit SHA with salt", + "sensitive" => false + ], + [ + "name" => "Pseudonymised_Registration_Number", + "dataType" => "String", + "description" => "Regstration number of staff member, encrypted with 256 bit SHA with salt", + "sensitive" => false + ] + ] + ] + ] + ]; + } } diff --git a/app/Http/Controllers/ServiceLayerController.php b/app/Http/Controllers/ServiceLayerController.php index fb2975733..5035f909f 100644 --- a/app/Http/Controllers/ServiceLayerController.php +++ b/app/Http/Controllers/ServiceLayerController.php @@ -19,8 +19,10 @@ public function getActiveFederationApplications(Request $request) $federations = Federation::with('team') ->where('enabled', 1) ->where('tested', 1) - ->get(); - return response()->json($federations); + ->get() + ->toArray(); + + return response(json_encode(array_values($federations)), 200, ['Content-Type' => 'application/json']); } public function setFederationInvalidRunState(Request $request, int $id) diff --git a/app/Http/Middleware/ProfileRequest.php b/app/Http/Middleware/ProfileRequest.php index 9946aab38..3b3610a6b 100644 --- a/app/Http/Middleware/ProfileRequest.php +++ b/app/Http/Middleware/ProfileRequest.php @@ -27,35 +27,35 @@ class ProfileRequest */ public function handle(Request $request, Closure $next): JsonResponse|StreamedResponse|RedirectResponse|Response|BinaryFileResponse|SymfonyResponse { - if (Config::get('profiling.profiler_active')) { - // Create our profiler - $timer = new Timer(); - $timer->start(); - - // Process the request - $response = $next($request); - - if ($response instanceof JsonResponse) { - // Stop our profiler - $duration = (new ResourceUsageFormatter())->resourceUsage($timer->stop()); - $parts = explode('\\', $request->route()->getAction()['controller']); - $className = $parts[count($parts) - 1]; - - $resourceUsed = [ - 'explicitOperation' => $className, - 'operationResource' => $duration, - ]; - - $response->setData($response->getData(true) + [ - '_profiler' => $resourceUsed, - ]); - } else { - return $next($request); - } - - // Return response with profiling appended to payload - return $response; - } + // if (Config::get('profiling.profiler_active')) { + // // Create our profiler + // $timer = new Timer(); + // $timer->start(); + + // // Process the request + // $response = $next($request); + + // if ($response instanceof JsonResponse) { + // // Stop our profiler + // $duration = (new ResourceUsageFormatter())->resourceUsage($timer->stop()); + // $parts = explode('\\', $request->route()->getAction()['controller']); + // $className = $parts[count($parts) - 1]; + + // $resourceUsed = [ + // 'explicitOperation' => $className, + // 'operationResource' => $duration, + // ]; + + // $response->setData($response->getData(true) + [ + // '_profiler' => $resourceUsed, + // ]); + // } else { + // return $next($request); + // } + + // // Return response with profiling appended to payload + // return $response; + // } return $next($request); } diff --git a/config/routes.php b/config/routes.php index c99fbadbc..82759416a 100644 --- a/config/routes.php +++ b/config/routes.php @@ -4171,4 +4171,29 @@ 'id' => '[0-9]+', ], ], + + /// + + [ + 'name' => '/test/datasets', + 'method' => 'get', + 'path' => '/test/datasets', + 'methodController' => 'TestController@testListDatasets', + 'namespaceController' => 'App\Http\Controllers\Api\V1', + 'middleware' => [ + ], + 'constraint' => [ + ], + ], + [ + 'name' => '/test/datasets/{id}', + 'method' => 'get', + 'path' => '/test/datasets/{id}', + 'methodController' => 'TestController@testListDatasetId', + 'namespaceController' => 'App\Http\Controllers\Api\V1', + 'middleware' => [ + ], + 'constraint' => [ + ], + ], ]; diff --git a/traser.http b/traser.http index 1cf4b1000..ad2037718 100644 --- a/traser.http +++ b/traser.http @@ -668,4 +668,768 @@ Accept: application/json } ] } +} + +### test +# POST {{baseUrl}}/validate?input_schema=GWDM&input_version=2.0 +POST https://hdr-gateway-traser-dev-qmnkcg5qjq-ew.a.run.app/validate?input_schema=HDRUK&input_version=2.1.2 +Content-Type: application/json +Accept: application/json + +{ + "metadata": { + "accessibility": { + "access": { + "accessRequestCost": "To be agreed per project by SDE program", + "accessRights": "", + "accessService": " ", + "dataController": "Kent and Medway ICB", + "dataProcessor": "Kent and Medway Data Warehouse", + "deliveryLeadTime": "1-2 MONTHS", + "jurisdiction": [ + "GB-ENG" + ] + }, + "formatAndStandards": { + "conformsTo": [ + "LOCAL" + ], + "format": [ + "Text" + ], + "language": [ + "en" + ], + "vocabularyEncodingScheme": [ + "READ", + "NHS NATIONAL CODES", + "ODS" + ] + }, + "usage": { + "dataUseLimitation": [ + "RESEARCH SPECIFIC RESTRICTIONS" + ], + "dataUseRequirements": [ + "ETHICS APPROVAL REQUIRED", + "GEOGRAPHICAL RESTRICTIONS", + "NOT FOR PROFIT USE", + "PROJECT SPECIFIC RESTRICTIONS", + "TIME LIMIT ON USE", + "USER SPECIFIC RESTRICTION" + ], + "resourceCreator": [ + "Kent and Mewday ICB", + "Kent and Medway Data Warehouse" + ] + } + }, + "coverage": { + "followup": "UNKNOWN", + "physicalSampleAvailability": [ + "NOT AVAILABLE" + ], + "spatial": "Kent and Medway", + "typicalAgeRange": "0-120" + }, + "documentation": { + "description": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "isPartOf": [ + "Primary Care Data" + ] + }, + "identifier": "242c84be-a866-ac0c-0000-000000001bbe", + "issued": "2024-03-09T23:22:07+00:00", + "modified": "2024-07-03T09:55:18+00:00", + "observations": [ + { + "disambiguatingDescription": " ", + "measuredProperty": "COUNT", + "measuredValue": 1756178, + "observationDate": "2019-06-24", + "observedNode": "PERSONS" + }, + { + "disambiguatingDescription": " ", + "measuredProperty": "COUNT", + "measuredValue": 732236154, + "observationDate": "2019-06-24", + "observedNode": "EVENTS" + } + ], + "provenance": { + "origin": { + "collectionSituation": [ + "PRIMARY CARE" + ], + "purpose": [ + "CARE" + ], + "source": [ + "EPR" + ] + }, + "temporal": { + "accrualPeriodicity": "STATIC", + "distributionReleaseDate": "2019-06-24", + "endDate": "2019-06-24", + "startDate": "1901-01-01", + "timeLag": "NOT APPLICABLE" + } + }, + "revisions": [ + { + "url": "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=7102", + "version": "1.0.0" + } + ], + "structuralMetadata": [ + { + "description": "Primary Care Event Table", + "elements": [ + { + "dataType": "String", + "description": "Unique reference to the record", + "name": "Unique_ID", + "sensitive": false + }, + { + "dataType": "String", + "description": "Commissioner for the event", + "name": "Commissioner_Code", + "sensitive": false + }, + { + "dataType": "String", + "description": "Code for GP practice that is as at the activity date", + "name": "Practice_Code", + "sensitive": false + }, + { + "dataType": "Integer", + "description": "Age of patient at activity date", + "name": "Age ", + "sensitive": false + }, + { + "dataType": "String", + "description": "Sex of patient at activity date", + "name": "Sex ", + "sensitive": false + }, + { + "dataType": "String", + "description": "Read code of the event", + "name": "Event_Read_Code", + "sensitive": false + }, + { + "dataType": "floating point", + "description": "Numeric result of the event", + "name": "Num_Result", + "sensitive": false + }, + { + "dataType": "floating point", + "description": "Second numeric result of the event", + "name": "Num_Result_2", + "sensitive": false + }, + { + "dataType": "date", + "description": "Date of the event activity", + "name": "Activity_Date", + "sensitive": false + }, + { + "dataType": "String", + "description": "NHS number of patient, encrypted with 256 bit SHA with salt", + "name": "Pseudonymised_NHS_Number", + "sensitive": false + }, + { + "dataType": "String", + "description": "Unique reference to the consultation record", + "name": "Unique_Consultation_ID", + "sensitive": false + }, + { + "dataType": "bigint", + "description": "SNOMED concept of Event (https://www.datadictionary.nhs.uk/data_elements/snomed_ct_code.html)", + "name": "SNOMED_Concept", + "sensitive": false + }, + { + "dataType": "bigint", + "description": "SNOMED description of Event", + "name": "SNOMED_Description", + "sensitive": false + } + ], + "name": "GP_Event" + } + ], + "summary": { + "abstract": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "contactPoint": "kmicb.bi@nhs.net", + "doiName": "10.81022/wfv3-tz28", + "keywords": [ + "General practitioner", + "Event", + "GP ", + "HDRUK", + "Primary care" + ], + "publisher": { + "contactPoint": [ + "kmicb.bi@nhs.net" + ], + "description": "https://www.kentandmedway.icb.nhs.uk/about-us", + "logo": "https://www.kentandmedway.icb.nhs.uk/application/files/cache/thumbnails/b9a92ca7b10d21ae1cdf056d95e99659.png", + "memberOf": "OTHER", + "name": "Kent & Medway Data Warehouse" + }, + "title": "Kent Integrated Dataset - GP Event" + }, + "version": "1.0.0" + } +} + + + +### test translation 1.1 +# POST {{baseUrl}}/validate?input_schema=GWDM&input_version=2.0 +POST https://hdr-gateway-traser-dev-qmnkcg5qjq-ew.a.run.app/translate?output_schema=GWDM&output_version=1.1&validate_input=1&validate_output=1 +Content-Type: application/json +Accept: application/json + +{ + "extra": { + "id": "placeholder", + "pid": "placeholder", + "datasetType": "Health and disease", + "publisherId": "21", + "publisherName": "Kent & Medway Data Warehouse" + }, + "metadata": { + "accessibility": { + "access": { + "accessRequestCost": "To be agreed per project by SDE program", + "accessRights": "", + "accessService": " ", + "dataController": "Kent and Medway ICB", + "dataProcessor": "Kent and Medway Data Warehouse", + "deliveryLeadTime": "1-2 MONTHS", + "jurisdiction": [ + "GB-ENG" + ] + }, + "formatAndStandards": { + "conformsTo": [ + "LOCAL" + ], + "format": [ + "Text" + ], + "language": [ + "en" + ], + "vocabularyEncodingScheme": [ + "READ", + "NHS NATIONAL CODES", + "ODS" + ] + }, + "usage": { + "dataUseLimitation": [ + "RESEARCH SPECIFIC RESTRICTIONS" + ], + "dataUseRequirements": [ + "ETHICS APPROVAL REQUIRED", + "GEOGRAPHICAL RESTRICTIONS", + "NOT FOR PROFIT USE", + "PROJECT SPECIFIC RESTRICTIONS", + "TIME LIMIT ON USE", + "USER SPECIFIC RESTRICTION" + ], + "resourceCreator": [ + "Kent and Mewday ICB", + "Kent and Medway Data Warehouse" + ] + } + }, + "coverage": { + "followup": "UNKNOWN", + "physicalSampleAvailability": [ + "NOT AVAILABLE" + ], + "spatial": "Kent and Medway", + "typicalAgeRange": "0-120" + }, + "documentation": { + "description": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "isPartOf": [ + "Primary Care Data" + ] + }, + "identifier": "242c84be-a866-ac0c-0000-000000001bbe", + "issued": "2024-03-09T23:22:07+00:00", + "modified": "2024-07-03T09:55:18+00:00", + "observations": [ + { + "disambiguatingDescription": " ", + "measuredProperty": "COUNT", + "measuredValue": 1756178, + "observationDate": "2019-06-24", + "observedNode": "PERSONS" + }, + { + "disambiguatingDescription": " ", + "measuredProperty": "COUNT", + "measuredValue": 732236154, + "observationDate": "2019-06-24", + "observedNode": "EVENTS" + } + ], + "provenance": { + "origin": { + "collectionSituation": [ + "PRIMARY CARE" + ], + "purpose": [ + "CARE" + ], + "source": [ + "EPR" + ] + }, + "temporal": { + "accrualPeriodicity": "STATIC", + "distributionReleaseDate": "2019-06-24", + "endDate": "2019-06-24", + "startDate": "1901-01-01", + "timeLag": "NOT APPLICABLE" + } + }, + "revisions": [ + { + "url": "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=7102", + "version": "1.0.0" + } + ], + "structuralMetadata": [ + { + "description": "Primary Care Event Table", + "elements": [ + { + "dataType": "String", + "description": "Unique reference to the record", + "name": "Unique_ID", + "sensitive": false + }, + { + "dataType": "String", + "description": "Commissioner for the event", + "name": "Commissioner_Code", + "sensitive": false + }, + { + "dataType": "String", + "description": "Code for GP practice that is as at the activity date", + "name": "Practice_Code", + "sensitive": false + }, + { + "dataType": "Integer", + "description": "Age of patient at activity date", + "name": "Age ", + "sensitive": false + }, + { + "dataType": "String", + "description": "Sex of patient at activity date", + "name": "Sex ", + "sensitive": false + }, + { + "dataType": "String", + "description": "Read code of the event", + "name": "Event_Read_Code", + "sensitive": false + }, + { + "dataType": "floating point", + "description": "Numeric result of the event", + "name": "Num_Result", + "sensitive": false + }, + { + "dataType": "floating point", + "description": "Second numeric result of the event", + "name": "Num_Result_2", + "sensitive": false + }, + { + "dataType": "date", + "description": "Date of the event activity", + "name": "Activity_Date", + "sensitive": false + }, + { + "dataType": "String", + "description": "NHS number of patient, encrypted with 256 bit SHA with salt", + "name": "Pseudonymised_NHS_Number", + "sensitive": false + }, + { + "dataType": "String", + "description": "Unique reference to the consultation record", + "name": "Unique_Consultation_ID", + "sensitive": false + }, + { + "dataType": "bigint", + "description": "SNOMED concept of Event (https://www.datadictionary.nhs.uk/data_elements/snomed_ct_code.html)", + "name": "SNOMED_Concept", + "sensitive": false + }, + { + "dataType": "bigint", + "description": "SNOMED description of Event", + "name": "SNOMED_Description", + "sensitive": false + } + ], + "name": "GP_Event" + } + ], + "summary": { + "abstract": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "contactPoint": "kmicb.bi@nhs.net", + "doiName": "10.81022/wfv3-tz28", + "keywords": [ + "General practitioner", + "Event", + "GP ", + "HDRUK", + "Primary care" + ], + "publisher": { + "contactPoint": [ + "kmicb.bi@nhs.net" + ], + "description": "https://www.kentandmedway.icb.nhs.uk/about-us", + "logo": "https://www.kentandmedway.icb.nhs.uk/application/files/cache/thumbnails/b9a92ca7b10d21ae1cdf056d95e99659.png", + "memberOf": "OTHER", + "name": "Kent & Medway Data Warehouse" + }, + "title": "Kent Integrated Dataset - GP Event" + }, + "version": "1.0.0" + } +} + + + +### test translation 1.2 +# POST {{baseUrl}}/validate?input_schema=GWDM&input_version=2.0 +POST https://hdr-gateway-traser-dev-qmnkcg5qjq-ew.a.run.app/translate?output_schema=GWDM&output_version=1.2&validate_input=1&validate_output=1 +Content-Type: application/json +Accept: application/json + +{ + "metadata": { + "required": { + "gatewayId": "placeholder", + "gatewayPid": "placeholder", + "issued": "2024-03-09T23:22:07+00:00", + "modified": "2024-07-03T09:55:18+00:00", + "revisions": [ + { + "version": "1.0.0", + "url": "https://nhse-ics-kms-uat5-ui.metadata.works/browser/dataset?id=7102" + } + ], + "version": "1.0.0" + }, + "summary": { + "abstract": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "contactPoint": "kmicb.bi@nhs.net", + "keywords": "General practitioner;,;Event;,;GP ;,;HDRUK;,;Primary care", + "controlledKeywords": null, + "datasetType": "Health and disease", + "description": "Primary Care Event information, recording the intereactions that patients with medical staff at GP practices and some read-coded numeric data", + "doiName": "10.81022/wfv3-tz28", + "shortTitle": "Kent Integrated Dataset - GP Event", + "title": "Kent Integrated Dataset - GP Event", + "publisher": { + "name": "Kent & Medway Data Warehouse", + "gatewayId": "21", + "rorId": null + }, + "populationSize": 1756178, + "datasetSubType": null + }, + "coverage": { + "pathway": null, + "spatial": "Kent and Medway", + "followup": "UNKNOWN", + "typicalAgeRange": "0-120", + "gender": null, + "biologicalsamples": null, + "psychological": null, + "physical": null, + "anthropometric": null, + "lifestyle": null, + "socioeconomic": null + }, + "provenance": { + "origin": { + "purpose": "CARE", + "source": "EPR", + "collectionSituation": "PRIMARY CARE" + }, + "temporal": { + "endDate": "2019-06-24", + "startDate": "1901-01-01", + "timeLag": "NOT APPLICABLE", + "accrualPeriodicity": "STATIC", + "distributionReleaseDate": "2019-06-24" + } + }, + "accessibility": { + "access": { + "deliveryLeadTime": "1-2 MONTHS", + "jurisdiction": "GB-ENG", + "dataController": "Kent and Medway ICB", + "dataProcessor": "Kent and Medway Data Warehouse", + "accessRights": null, + "accessService": " ", + "accessRequestCost": "To be agreed per project by SDE program" + }, + "usage": { + "dataUseLimitation": "RESEARCH SPECIFIC RESTRICTIONS", + "dataUseRequirement": "ETHICS APPROVAL REQUIRED;,;GEOGRAPHICAL RESTRICTIONS;,;NOT FOR PROFIT USE;,;PROJECT SPECIFIC RESTRICTIONS;,;TIME LIMIT ON USE;,;USER SPECIFIC RESTRICTION", + "resourceCreator": { + "name": "Kent and Mewday ICB;,;Kent and Medway Data Warehouse", + "gatewayId": null, + "rorId": null + } + }, + "formatAndStandards": { + "vocabularyEncodingSchemes": "READ;,;NHS NATIONAL CODES;,;ODS", + "conformsTo": "LOCAL", + "languages": "en", + "formats": "Text" + } + }, + "linkage": { + "associatedMedia": null, + "isReferenceIn": null, + "datasetLinkage": { + "isPartOf": "Primary Care Data", + "isDerivedFrom": null, + "isMemberOf": null, + "linkedDatasets": null + }, + "investigations": null, + "isGeneratedUsing": null, + "dataUses": null, + "tools": null + }, + "observations": [ + { + "observedNode": "PERSONS", + "measuredValue": 1756178, + "observationDate": "2019-06-24", + "measuredProperty": "COUNT", + "disambiguatingDescription": " " + }, + { + "observedNode": "EVENTS", + "measuredValue": 732236154, + "observationDate": "2019-06-24", + "measuredProperty": "COUNT", + "disambiguatingDescription": " " + } + ], + "structuralMetadata": [ + { + "description": "Primary Care Event Table", + "name": "GP_Event", + "columns": [ + { + "dataType": "String", + "description": "Unique reference to the record", + "name": "Unique_ID", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "Commissioner for the event", + "name": "Commissioner_Code", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "Code for GP practice that is as at the activity date", + "name": "Practice_Code", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "Integer", + "description": "Age of patient at activity date", + "name": "Age ", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "Sex of patient at activity date", + "name": "Sex ", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "Read code of the event", + "name": "Event_Read_Code", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "floating point", + "description": "Numeric result of the event", + "name": "Num_Result", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "floating point", + "description": "Second numeric result of the event", + "name": "Num_Result_2", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "date", + "description": "Date of the event activity", + "name": "Activity_Date", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "NHS number of patient, encrypted with 256 bit SHA with salt", + "name": "Pseudonymised_NHS_Number", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "String", + "description": "Unique reference to the consultation record", + "name": "Unique_Consultation_ID", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "bigint", + "description": "SNOMED concept of Event (https://www.datadictionary.nhs.uk/data_elements/snomed_ct_code.html)", + "name": "SNOMED_Concept", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + }, + { + "dataType": "bigint", + "description": "SNOMED description of Event", + "name": "SNOMED_Description", + "sensitive": false, + "values": [ + { + "name": "Male", + "frequency": 50, + "description": null + } + ] + } + ] + } + ], + "tissuesSampleCollection": null + } } \ No newline at end of file