From ebaa40e15c590c43b727822f6abff582891502c5 Mon Sep 17 00:00:00 2001 From: Jeremy Ho Date: Tue, 10 Dec 2024 17:24:57 -0800 Subject: [PATCH] Add preliminary process JSON Schema Signed-off-by: Jeremy Ho --- docs/spec/data/parcel_id.schema.json | 3 +- docs/spec/data/process.example.json | 8 ++-- docs/spec/data/process.mdx | 10 ++--- docs/spec/data/process.schema.json | 38 ++++++++++++------- docs/spec/resource/process_event.example.json | 14 +++---- 5 files changed, 41 insertions(+), 32 deletions(-) diff --git a/docs/spec/data/parcel_id.schema.json b/docs/spec/data/parcel_id.schema.json index 01c576d..e99e10c 100644 --- a/docs/spec/data/parcel_id.schema.json +++ b/docs/spec/data/parcel_id.schema.json @@ -41,5 +41,6 @@ "title": "pin", "required": ["pin"] } - ] + ], + "additionalProperties": false } diff --git a/docs/spec/data/process.example.json b/docs/spec/data/process.example.json index e3f569c..3b5cdea 100644 --- a/docs/spec/data/process.example.json +++ b/docs/spec/data/process.example.json @@ -1,8 +1,6 @@ { - "class": "status", + "class": ["Application", "Review", "Assessment"], + "concept": "http://bcgov.github.io/nr-pies/docs/concept/process_tracking", "description": "The authorization request is under review by subject matter expert.", - "parent_class": "stage", - "parent_concept": "underreview", - "system": "http://bcgov.github.io/nr-pies/docs/concept/process_tracking", - "value": "pending review" + "status": "UnderReview" } diff --git a/docs/spec/data/process.mdx b/docs/spec/data/process.mdx index 7462f8b..f724826 100644 --- a/docs/spec/data/process.mdx +++ b/docs/spec/data/process.mdx @@ -1,7 +1,7 @@ --- id: process title: Process -description: Represents a process concept. +description: Represents a process tracking concept. tags: - developer --- @@ -12,9 +12,9 @@ import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; import Example from "@site/docs/spec/data/process.example.json"; -// import Schema from "@site/docs/spec/data/process.schema.json"; +import Schema from "@site/docs/spec/data/process.schema.json"; -Represents a process concept. +Represents a process tracking concept. ## Scope @@ -31,14 +31,14 @@ Loosely taking inspiration from [HL7 Timing](https://www.hl7.org/fhir/datatypes. ## Specification - {/* + {JSON.stringify(Schema, null, 2)} - */} + {JSON.stringify(Example, null, 2)} diff --git a/docs/spec/data/process.schema.json b/docs/spec/data/process.schema.json index 8f7888a..c31a535 100644 --- a/docs/spec/data/process.schema.json +++ b/docs/spec/data/process.schema.json @@ -1,23 +1,35 @@ { "$id": "https://github.com/bcgov/nr-pies/blob/main/docs/spec/types/project_bundle.schema.json", - "$schema": "https://json-schema.org/draft-07/schema", - "title": "Project Bundle", - "description": "An identifier for a specific area with clear boundaries.", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Process", + "description": "Represents a process tracking concept.", "type": "object", "properties": { - "project_id": { - "type": "string", - "description": "A unique key to track all permits related to a project or activity across all permitting systems.", - "pattern": "/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i" + "class": { + "type": "array", + "items": { + "type": "string", + "description": "A process tracking term." + }, + "minItems": 1, + "maxItems": 3, + "uniqueItems": true }, - "project_name": { + "concept": { "type": "string", - "description": "Short name of the project." + "description": "A reference to the concept map encodings used.", + "format": "uri", + "pattern": "^https://bcgov.github.io/nr-pies/docs/concept/*$" }, - "project_description": { - "type": "string", - "description": "Full description of the project. This may contain information to better understand a project." + "description": { + "description": "An optional description of the status if present.", + "type": "string" + }, + "status": { + "description": "A description of the current condition or update of an application or authorization. Additional details about the current state are frequently conveyed (e.g., 'Pending Review', 'Under Inspection'). Statuses may be defined by the line of business.", + "type": "string" } }, - "required": ["project_id", "project_name"] + "required": ["class", "concept"], + "additionalProperties": false } diff --git a/docs/spec/resource/process_event.example.json b/docs/spec/resource/process_event.example.json index 1024c68..b6d2aa6 100644 --- a/docs/spec/resource/process_event.example.json +++ b/docs/spec/resource/process_event.example.json @@ -1,19 +1,17 @@ { "event": [ { - "start": "2017-01-01T00:00:00.000Z", - "end": "2017-01-02T00:00:00.000Z" + "start": "2017-01-02T00:00:00.000Z", + "end": "2017-01-03T00:00:00.000Z" }, { - "start": "2017-01-03T00:00:00.000Z" + "start": "2017-01-04T00:00:00.000Z" } ], "process": { - "class": "status", + "class": ["Application", "Review", "Assessment"], + "concept": "http://bcgov.github.io/nr-pies/docs/concept/process_tracking", "description": "The authorization request is under review by subject matter expert.", - "parent_class": "stage", - "parent_concept": "underreview", - "system": "http://bcgov.github.io/nr-pies/docs/concept/process_tracking", - "value": "pending review" + "status": "UnderReview" } }