{
    "resourceType": "StructureDefinition",
    "id": "MyServiceRequest",
    "extension":  [
        {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
            "valueString": "Clinical.Care Provision"
        },
        {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
            "valueCode": "patient"
        }
    ],
    "url": "http://example.org/StructureDefinition/MyServiceRequest",
    "name": "MyServiceRequest",
    "status": "active",
    "fhirVersion": "4.0.1",
    "mapping":  [
        {
            "identity": "workflow",
            "uri": "http://hl7.org/fhir/workflow",
            "name": "Workflow Pattern"
        },
        {
            "identity": "v2",
            "uri": "http://hl7.org/v2",
            "name": "HL7 v2 Mapping"
        },
        {
            "identity": "rim",
            "uri": "http://hl7.org/v3",
            "name": "RIM Mapping"
        },
        {
            "identity": "w5",
            "uri": "http://hl7.org/fhir/fivews",
            "name": "FiveWs Pattern Mapping"
        },
        {
            "identity": "quick",
            "uri": "http://siframework.org/cqf",
            "name": "Quality Improvement and Clinical Knowledge (QUICK)"
        }
    ],
    "kind": "resource",
    "abstract": false,
    "type": "ServiceRequest",
    "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
    "derivation": "constraint",
    "differential": {
        "element":  [
            {
                "id": "ServiceRequest.identifier",
                "path": "ServiceRequest.identifier",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "system"
                        }
                    ],
                    "rules": "open",
                    "description": "Slice"
                },
                "min": 1
            },
            {
                "id": "ServiceRequest.identifier:PLAC",
                "path": "ServiceRequest.identifier",
                "sliceName": "PLAC",
                "min": 1,
                "max": "1"
            },
            {
                "id": "ServiceRequest.identifier:PLAC.type.coding.code",
                "path": "ServiceRequest.identifier.type.coding.code",
                "patternCode": "PLAC"
            },
            {
                "id": "ServiceRequest.identifier:PLAC.type.coding.display",
                "path": "ServiceRequest.identifier.type.coding.display",
                "patternString": "Placer identifier"
            },
            {
                "id": "ServiceRequest.identifier:PLAC.system",
                "path": "ServiceRequest.identifier.system",
                "min": 1,
                "patternUri": "http://terminology.hl7.org/CodeSystem/v2-0203"
            },
            {
                "id": "ServiceRequest.identifier:PLAC.value",
                "path": "ServiceRequest.identifier.value",
                "min": 1
            },
            {
                "id": "ServiceRequest.requisition",
                "path": "ServiceRequest.requisition",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "system"
                        }
                    ],
                    "rules": "open",
                    "description": "Slice"
                }
            },
            {
                "id": "ServiceRequest.requisition:PGN",
                "path": "ServiceRequest.requisition",
                "sliceName": "PGN",
                "min": 0,
                "max": "1"
            },
            {
                "id": "ServiceRequest.requisition:PGN.type.coding.code",
                "path": "ServiceRequest.requisition.type.coding.code",
                "patternCode": "PGN"
            },
            {
                "id": "ServiceRequest.requisition:PGN.type.coding.display",
                "path": "ServiceRequest.requisition.type.coding.display",
                "patternString": "Placer Group Number"
            },
            {
                "id": "ServiceRequest.requisition:PGN.system",
                "path": "ServiceRequest.requisition.system",
                "min": 1,
                "patternUri": "http://terminology.hl7.org/CodeSystem/v2-0203"
            },
            {
                "id": "ServiceRequest.requisition:PGN.value",
                "path": "ServiceRequest.requisition.value",
                "min": 1
            },
            {
                "id": "ServiceRequest.status",
                "path": "ServiceRequest.status",
                "binding": {
                    "strength": "required",
                    "valueSet": "http://hl7.org/fhir/request-status"
                }
            },
            {
                "id": "ServiceRequest.intent",
                "path": "ServiceRequest.intent",
                "binding": {
                    "strength": "required",
                    "valueSet": "http://hl7.org/fhir/request-intent"
                }
            },
            {
                "id": "ServiceRequest.priority",
                "path": "ServiceRequest.priority",
                "binding": {
                    "strength": "required",
                    "valueSet": "http://hl7.org/fhir/request-priority"
                }
            },
            {
                "id": "ServiceRequest.code",
                "path": "ServiceRequest.code",
                "binding": {
                    "strength": "required",
                    "valueSet": "https://example.org/StructureDefinition/Atos"
                }
            },
            {
                "id": "ServiceRequest.subject",
                "path": "ServiceRequest.subject",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile":  [
                            "http://hl7.org/fhir/StructureDefinition/Patient"
                        ]
                    }
                ]
            },
            {
                "id": "ServiceRequest.encounter",
                "path": "ServiceRequest.encounter",
                "min": 1
            },
            {
                "id": "ServiceRequest.occurrence[x]",
                "path": "ServiceRequest.occurrence[x]",
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ]
            },
            {
                "id": "ServiceRequest.authoredOn",
                "path": "ServiceRequest.authoredOn",
                "min": 1
            },
            {
                "id": "ServiceRequest.requester",
                "path": "ServiceRequest.requester",
                "min": 1
            },
            {
                "id": "ServiceRequest.performer",
                "path": "ServiceRequest.performer",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile":  [
                            "http://hl7.org/fhir/StructureDefinition/HealthcareService",
                            "http://hl7.org/fhir/StructureDefinition/Practitioner"
                        ]
                    }
                ]
            },
            {
                "id": "ServiceRequest.reasonCode",
                "path": "ServiceRequest.reasonCode",
                "binding": {
                    "strength": "required",
                    "valueSet": "https://example.org/StructureDefinition/ICD"
                }
            },
            {
                "id": "ServiceRequest.supportingInfo",
                "path": "ServiceRequest.supportingInfo",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile":  [
                            "http://hl7.org/fhir/StructureDefinition/InsurancePlan"
                        ]
                    }
                ]
            },
            {
                "id": "ServiceRequest.note",
                "path": "ServiceRequest.note",
                "max": "1"
            }
        ]
    }
}
{
    "resourceType": "ValueSet",
    "status": "draft",
    "name": "ProcedureCode",
    "id": "ProcedureCode",
    "title": "ProcedureCode",
    "version": "1.0",
    "url": "https://example.org/StructureDefinition/Atos"
}
{
    "resourceType": "ValueSet",
    "status": "draft",
    "name": "RequestStatus",
    "id": "RequestStatus",
    "title": "RequestStatus",
    "version": "1.0",
    "url": "http://hl7.org/fhir/request-status"
}
{
    "resourceType": "ValueSet",
    "status": "draft",
    "name": "EncounterReasonCode",
    "id": "EncounterReasonCode",
    "title": "EncounterReasonCode",
    "version": "1.0",
    "url": "https://example.org/StructureDefinition/ICD"
}
{
    "resourceType": "ValueSet",
    "status": "draft",
    "name": "RequestPriority",
    "id": "RequestPriority",
    "title": "RequestPriority",
    "version": "1.0",
    "url": "http://hl7.org/fhir/request-priority"
}
{
    "resourceType": "ValueSet",
    "status": "draft",
    "name": "Intent",
    "id": "intent",
    "title": "intent",
    "version": "1.0",
    "url": "http://hl7.org/fhir/request-intent"
}