﻿{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Employer",
  "title": "Employer",
  "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": {
      "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/CodeableConcept"
    },
    "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"
      }
    },
    "identifier": {
      "description": "Identyfikatory strony",
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Identifier"
      }
    },
    "name": {
      "description": "Nazwa / firma",
      "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/CodeableConcept"
    },
    "number": {
      "description": "Numer strony",
      "type": "string"
    },
    "address": {
      "description": "Adresy",
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Address"
      }
    },
    "contactPoint": {
      "description": "Dane kontaktowe",
      "type": "array",
      "items": {
        "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/ContactPoint"
      }
    },
    "partOf": {
      "description": "Strona nadrz\u0119dna",
      "$ref": "https://api-erp.kamsoft.pl/ns/StructureDefinition/Reference"
    }
  },
  "required": [
    "category"
  ],
  "allOf": [
    {
      "properties": {
        "category": {
          "contains": {
            "required": [
              "coding"
            ],
            "properties": {
              "coding": {
                "contains": {
                  "required": [
                    "code",
                    "system"
                  ],
                  "properties": {
                    "code": {
                      "const": "employer"
                    },
                    "system": {
                      "const": "https://api-erp.kamsoft.pl/vs/party-kind"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}