{
  "resourceType": "StructureDefinition",
  "url": "https://api-erp.kamsoft.pl/ns/StructureDefinition/PurchaseOrder",
  "name": "PurchaseOrder",
  "version": "1.0.0",
  "title": "Zamówienie zakupu (PurchaseOrder)",
  "description": "Zasób kanoniczny FK — zamówienie u dostawcy: strony, pozycje, kwoty, terminy.",
  "kind": "resource",
  "abstract": false,
  "type": "PurchaseOrder",
  "baseDefinition": "https://api-erp.kamsoft.pl/ns/StructureDefinition/DomainResource",
  "snapshot": {
    "element": [
      {
        "path": "PurchaseOrder.identifier",
        "min": 0,
        "max": "*",
        "short": "Identyfikatory zamówienia",
        "type": [
          {
            "code": "Identifier[]"
          }
        ]
      },
      {
        "path": "PurchaseOrder.issueDate",
        "min": 0,
        "max": "1",
        "short": "Data wystawienia",
        "type": [
          {
            "code": "String"
          }
        ]
      },
      {
        "path": "PurchaseOrder.party",
        "min": 0,
        "max": "*",
        "short": "Strony",
        "definition": "Dostawca, inni uczestnicy (Reference).",
        "type": [
          {
            "code": "Reference[]"
          }
        ]
      },
      {
        "path": "PurchaseOrder.position",
        "min": 0,
        "max": "*",
        "short": "Pozycje zamówienia",
        "type": [
          {
            "code": "PurchaseOrderPosition[]"
          }
        ]
      },
      {
        "path": "PurchaseOrder.amount",
        "min": 0,
        "max": "1",
        "short": "Kwota zamówienia",
        "type": [
          {
            "code": "Money"
          }
        ]
      },
      {
        "path": "PurchaseOrder.expectedDeliveryDate",
        "min": 0,
        "max": "1",
        "short": "Oczekiwana data dostawy",
        "type": [
          {
            "code": "String"
          }
        ]
      },
      {
        "path": "PurchaseOrder.dueDate",
        "min": 0,
        "max": "1",
        "short": "Termin płatności",
        "type": [
          {
            "code": "String"
          }
        ]
      },
      {
        "path": "PurchaseOrder.paymentTerms",
        "min": 0,
        "max": "1",
        "short": "Warunki płatności",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "binding": {
          "valueSet": "https://api-erp.kamsoft.pl/ns/purchase-order-payment-terms"
        }
      },
      {
        "path": "PurchaseOrder.sourceDocument",
        "min": 0,
        "max": "1",
        "short": "Dokument źródłowy",
        "type": [
          {
            "code": "Reference"
          }
        ]
      },
      {
        "path": "PurchaseOrder.relatedDocument",
        "min": 0,
        "max": "*",
        "short": "Powiązane dokumenty",
        "type": [
          {
            "code": "Reference[]"
          }
        ]
      }
    ]
  }
}