{
  "resourceType": "StructureDefinition",
  "url": "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPerson",
  "name": "DIPSRelatedPerson",
  "status": "draft",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "RelatedPerson",
  "baseDefinition": "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson",
  "derivation": "constraint",
  "snapshot": {},
  "differential": {
    "element": [
      {
        "id": "RelatedPerson.extension",
        "path": "RelatedPerson.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "RelatedPerson.extension:kinship",
        "path": "RelatedPerson.extension",
        "sliceName": "kinship",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPersonKinship"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.extension:parentalResponsibility",
        "path": "RelatedPerson.extension",
        "sliceName": "parentalResponsibility",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPersonParentalResponsibility"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.extension:appointedByMunicipality",
        "path": "RelatedPerson.extension",
        "sliceName": "appointedByMunicipality",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPersonAppointedByMunicipality"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.extension:responsibleRequisitioner",
        "path": "RelatedPerson.extension",
        "sliceName": "responsibleRequisitioner",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPersonResponsibleRequisitioner"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.extension:additionalInformation",
        "path": "RelatedPerson.extension",
        "sliceName": "additionalInformation",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSRelatedPersonAdditionalInformation"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.identifier:guardianId",
        "path": "RelatedPerson.identifier",
        "sliceName": "guardianId"
      },
      {
        "id": "RelatedPerson.identifier:guardianId.system",
        "path": "RelatedPerson.identifier.system",
        "min": 1
      },
      {
        "id": "RelatedPerson.identifier:guardianId.value",
        "path": "RelatedPerson.identifier.value",
        "min": 1
      },
      {
        "id": "RelatedPerson.identifier:relativeId",
        "path": "RelatedPerson.identifier",
        "sliceName": "relativeId"
      },
      {
        "id": "RelatedPerson.identifier:relativeId.system",
        "path": "RelatedPerson.identifier.system",
        "min": 1
      },
      {
        "id": "RelatedPerson.identifier:relativeId.value",
        "path": "RelatedPerson.identifier.value",
        "min": 1
      },
      {
        "id": "RelatedPerson.active",
        "path": "RelatedPerson.active",
        "definition": "dipscoredb.dwperson table mors column"
      },
      {
        "id": "RelatedPerson.patient",
        "path": "RelatedPerson.patient",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/DIPSBasisPatientR4Reference"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.relationship:maritalStatus",
        "path": "RelatedPerson.relationship",
        "sliceName": "maritalStatus",
        "max": "0"
      },
      {
        "id": "RelatedPerson.relationship:relativeType",
        "path": "RelatedPerson.relationship",
        "sliceName": "relativeType"
      },
      {
        "id": "RelatedPerson.relationship:relativeType.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "fixedUri": "urn:oid:1.3.6.1.4.1.9038.52.1045"
      },
      {
        "id": "RelatedPerson.relationship:caringFunction",
        "path": "RelatedPerson.relationship",
        "sliceName": "caringFunction"
      },
      {
        "id": "RelatedPerson.relationship:caringFunction.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "fixedUri": "urn:oid:1.3.6.1.4.1.9038.52.4353"
      },
      {
        "id": "RelatedPerson.relationship:guardian",
        "path": "RelatedPerson.relationship",
        "sliceName": "guardian"
      },
      {
        "id": "RelatedPerson.relationship:guardian.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "fixedUri": "urn:oid:1.3.6.1.4.1.9038.52.3508"
      },
      {
        "id": "RelatedPerson.relationship:relationshipType",
        "path": "RelatedPerson.relationship",
        "sliceName": "relationshipType"
      },
      {
        "id": "RelatedPerson.relationship:relationshipType.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "fixedUri": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
      },
      {
        "id": "RelatedPerson.relationship:dipsRelation",
        "path": "RelatedPerson.relationship",
        "sliceName": "dipsRelation"
      },
      {
        "id": "RelatedPerson.relationship:dipsRelation.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "fixedUri": "urn:oid:1.3.6.1.4.1.9038.52.3210"
      },
      {
        "id": "RelatedPerson.name.text",
        "path": "RelatedPerson.name.text",
        "definition": "dipscoredb.dwperson table fornavn column and dipscoredb.dwperson table etternavn column"
      },
      {
        "id": "RelatedPerson.name.family",
        "path": "RelatedPerson.name.family",
        "definition": "dipscoredb.dwperson table etternavn column"
      },
      {
        "id": "RelatedPerson.name.given",
        "path": "RelatedPerson.name.given",
        "definition": "dipscoredb.dwperson table fornavn column"
      },
      {
        "id": "RelatedPerson.gender",
        "path": "RelatedPerson.gender",
        "definition": "dipscoredb.dwperson table gender column"
      },
      {
        "id": "RelatedPerson.birthDate",
        "path": "RelatedPerson.birthDate",
        "definition": "dipscoredb.dwperson table foedselsdato column"
      },
      {
        "id": "RelatedPerson.address.line",
        "path": "RelatedPerson.address.line",
        "definition": "dipscoredb.dwadresse table adresseid column"
      },
      {
        "id": "RelatedPerson.address.city",
        "path": "RelatedPerson.address.city",
        "definition": "dipscoredb.dwkodeverkverdier table langtnavn column"
      },
      {
        "id": "RelatedPerson.address.district",
        "path": "RelatedPerson.address.district",
        "definition": "dipscoredb.dwkodeverkverdier bydel table langtnavn column"
      },
      {
        "id": "RelatedPerson.address.district.extension",
        "path": "RelatedPerson.address.district.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "RelatedPerson.address.district.extension:municipalityCode",
        "path": "RelatedPerson.address.district.extension",
        "sliceName": "municipalityCode",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://dips.no/fhir/StructureDefinition/R4/MunicipalityCode"
            ]
          }
        ]
      },
      {
        "id": "RelatedPerson.address.state",
        "path": "RelatedPerson.address.state",
        "definition": "dipscoredb.dwkodeverkverdier table kode column"
      },
      {
        "id": "RelatedPerson.address.postalCode",
        "path": "RelatedPerson.address.postalCode",
        "definition": "dipscoredb.dwkodeverkverdier table kode column"
      },
      {
        "id": "RelatedPerson.address.country",
        "path": "RelatedPerson.address.country",
        "definition": "dipscoredb.dwkodeverkverdier table langtnavn column"
      },
      {
        "id": "RelatedPerson.address.period.start",
        "path": "RelatedPerson.address.period.start",
        "definition": "dipscoredb.dwadresse table gyldigfradato column"
      },
      {
        "id": "RelatedPerson.address.period.end",
        "path": "RelatedPerson.address.period.end",
        "definition": "dipscoredb.dwadresse table gyldigtildato column"
      },
      {
        "id": "RelatedPerson.photo",
        "path": "RelatedPerson.photo",
        "max": "0"
      },
      {
        "id": "RelatedPerson.communication",
        "path": "RelatedPerson.communication",
        "max": "0"
      },
      {
        "id": "RelatedPerson.communication.language.coding.code",
        "path": "RelatedPerson.communication.language.coding.code",
        "definition": "dipscoredb.dwkodeverkverdier table kode column"
      },
      {
        "id": "RelatedPerson.communication.language.coding.display",
        "path": "RelatedPerson.communication.language.coding.display",
        "definition": "dipscoredb.dwkodeverkverdier table langtnavn column"
      }
    ]
  }
}