﻿{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api-erp.kamsoft.pl/ns/StructureDefinition/NamingSystem",
  "title": "NamingSystem",
  "version": "1.0.0",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "resourceType": {
      "type": "string"
    },
    "meta": {
      "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Meta"
    },
    "owner": {
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Reference"
      }
    },
    "comment": {
      "type": "string"
    },
    "category": {
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/CodeableConcept"
      }
    },
    "status": {
      "description": "Status publikacji: active",
      "type": "string"
    },
    "type": {
      "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/CodeableConcept"
    },
    "contained": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "attribute": {
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Attribute"
      }
    },
    "name": {
      "description": "Klucz przestrzeni, np. Party.Id",
      "type": "string"
    },
    "kind": {
      "description": "Rodzaj przestrzeni: codesystem, identifier, root",
      "type": "string"
    },
    "date": {
      "description": "Data publikacji / wypelnienia",
      "type": "string"
    },
    "publisher": {
      "description": "Wydawca przestrzeni",
      "type": "string"
    },
    "description": {
      "description": "Znaczenie przestrzeni, np. Id kontrahenta w kartotece ksiegowosci",
      "type": "string"
    },
    "usage": {
      "description": "Konwencja API.ERP: nazwa zasobu FAIR, ktorego identyfikatory niesie przestrzen, np. Party",
      "type": "string"
    },
    "uniqueId": {
      "description": "Unikalne identyfikatory przestrzeni (OID, URI)",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/NamingSystemUniqueId"
      }
    }
  },
  "required": [
    "status",
    "name",
    "kind",
    "date",
    "uniqueId"
  ]
}