{
  "resourceType": "StructureDefinition",
  "id": "pr-provenance",
  "meta": {
    "source": "https://www.icanbwell.com/fhir_profile_definitions",
    "security": [
      {
        "system": "https://www.icanbwell.com/owner",
        "code": "bwell"
      },
      {
        "system": "https://www.icanbwell.com/access",
        "code": "bwell"
      }
    ]
  },
  "url": "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-provenance",
  "version": "1.02",
  "name": "Provenance",
  "title": "Profile: Provenance",
  "status": "active",
  "experimental": false,
  "date": "2022-06-02",
  "publisher": "b.Well Connected Health",
  "description": "Provenance",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "urn:iso:std:iso:3166",
          "code": "US",
          "display": "United States of America"
        }
      ],
      "text": "United States of America"
    }
  ],
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Provenance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Provenance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Provenance",
        "path": "Provenance"
      },
      {
        "id": "Provenance.id",
        "path": "Provenance.id"
      },
      {
        "id": "Provenance.meta",
        "path": "Provenance.meta",
        "label": "meta",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Meta"
          }
        ]
      },
      {
        "id": "Provenance.meta.source",
        "path": "Provenance.meta.source",
        "sliceName": "meta-source",
        "label": "meta",
        "short": "uri of the data source",
        "definition": "Typically the data owner's URL followed by a source/file description",
        "requirements": "mandatory for all resources in bWell's FHIR Server",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "uri"
          }
        ],
        "example": [
          {
            "label": "example of meta.source",
            "valueUri": "https://www.icanbwell.com/provider-directory"
          }
        ]
      },
      {
        "id": "Provenance.meta.security",
        "path": "Provenance.meta.security",
        "sliceName": "meta-security",
        "label": "meta",
        "short": "security tags representing the data's owner, vendor, and accessibility",
        "definition": "data owner: \n \n data vendor: \n \n data access: ",
        "requirements": "/owner & /access are mandatory for all resources in bWell's FHIR Server",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "example": [
          {
            "label": "example of data owner security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/owner",
              "code": "bwell"
            }
          },
          {
            "label": "example of data access security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/access",
              "code": "bwell"
            }
          },
          {
            "label": "example of data vendor security tag",
            "valueCoding": {
              "system": "https://www.icanbwell.com/vendor",
              "code": "bwell"
            }
          }
        ]
      },
      {
        "id": "Provenance.target",
        "path": "Provenance.target",
        "short": "Link to EnrollmentRequest",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-enrollment-request"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Provenance.recorded",
        "path": "Provenance.recorded",
        "mustSupport": true
      },
      {
        "id": "agent",
        "path": "Provenance.agent",
        "label": "agent",
        "slicing": {
          "description": "slice by type",
          "rules": "open"
        },
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "agent.id",
        "path": "Provenance.agent.id",
        "label": "agent",
        "short": "set to type code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "agent.type",
        "path": "Provenance.agent.type",
        "label": "agent",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes",
              "code": "VERF"
            }
          ]
        },
        "mustSupport": true,
        "binding": {
          "strength": "extensible",
          "valueSet": "http://terminology.hl7.org/CodeSystem/contractsignertypecodes"
        }
      },
      {
        "id": "agent.who",
        "path": "Provenance.agent.who",
        "label": "agent",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature",
        "path": "Provenance.signature",
        "label": "signature",
        "slicing": {
          "description": "slice by type",
          "rules": "open"
        },
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature.id",
        "path": "Provenance.signature.id",
        "label": "signature",
        "short": "signature",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature.type",
        "path": "Provenance.signature.type",
        "label": "signature",
        "min": 1,
        "type": [
          {
            "code": "Coding"
          }
        ],
        "patternCoding": {
          "system": "urn:iso-astm:E1762-95:2013",
          "code": "1.2.840.10065.1.12.1.5",
          "display": "Verification Signature"
        },
        "mustSupport": true,
        "binding": {
          "strength": "example",
          "valueSet": "urn:iso-astm:E1762-95:2013"
        }
      },
      {
        "id": "de-signature.when",
        "path": "Provenance.signature.when",
        "label": "signature",
        "short": "When the signature was created",
        "min": 1,
        "type": [
          {
            "code": "instant"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature.who",
        "path": "Provenance.signature.who",
        "label": "signature",
        "short": "Who signed",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.icanbwell.com/4_0_0/StructureDefinition/pr-patient"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature.targetFormat",
        "path": "Provenance.signature.targetFormat",
        "label": "signature",
        "short": "The technical format of the signed resources",
        "type": [
          {
            "code": "code"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "de-signature.data",
        "path": "Provenance.signature.data",
        "label": "signature",
        "short": "The actual signature content (xml, picture, etc)",
        "min": 1,
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}