NIH-NCPI / ncpi-model-forge

🔥 The Project Forge FHIR model
Apache License 2.0
4 stars 5 forks source link

smilecdr error on `create document with nested extension` #32

Open bwalsh opened 4 years ago

bwalsh commented 4 years ago

Describe the Bug

Smile CDR returns a 500 when presented a resource with nested extension

To Reproduce

Step 1: Add profile and extensions

Profile: drs-attachment

{
  "resourceType": "StructureDefinition",
  "id": "drs-attachment",
  "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-attachment",
  "version": "0.2.1",
  "name": "DRSAttachment",
  "title": "DRS Attachment",
  "status": "active",
  "description": "A FHIR Attachment extended with DRS Object attributes.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "type": "Attachment",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Attachment",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Attachment.extension:drs",
        "path": "Attachment.extension",
        "sliceName": "drs",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-object"
            ]
          }
        ]
      },
      {
        "id": "Attachment.hash",
        "path": "Attachment.hash",
        "max": "0"
      }
    ]
  }
}

Extensions

{
  "resourceType": "StructureDefinition",
  "id": "drs-object",
  "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-object",
  "version": "0.2.1",
  "name": "DRSObject",
  "title": "DRS Object",
  "status": "active",
  "description": "The drs object",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Element"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "min": 6
      },
      {
        "id": "Extension.extension:id",
        "path": "Extension.extension",
        "sliceName": "id",
        "short": "An identifier unique to this `DrsObject`.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:id.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:id.url",
        "path": "Extension.extension.url",
        "fixedUri": "id"
      },
      {
        "id": "Extension.extension:id.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:name",
        "path": "Extension.extension",
        "sliceName": "name",
        "short": "A string that can be used to name a `DrsObject`.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:name.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:name.url",
        "path": "Extension.extension.url",
        "fixedUri": "name"
      },
      {
        "id": "Extension.extension:name.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:self_uri",
        "path": "Extension.extension",
        "sliceName": "self_uri",
        "short": "A drs:// URI, as defined in the DRS documentation, that tells clients how to access this object.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:self_uri.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:self_uri.url",
        "path": "Extension.extension.url",
        "fixedUri": "self_uri"
      },
      {
        "id": "Extension.extension:self_uri.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:size",
        "path": "Extension.extension",
        "sliceName": "size",
        "short": "For blobs, the blob size in bytes.  For bundles, the cumulative size, in bytes, of items in the `contents` field.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:size.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:size.url",
        "path": "Extension.extension.url",
        "fixedUri": "size"
      },
      {
        "id": "Extension.extension:size.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "decimal"
          }
        ]
      },
      {
        "id": "Extension.extension:created_time",
        "path": "Extension.extension",
        "sliceName": "created_time",
        "short": "Timestamp of content creation in RFC3339.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:created_time.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:created_time.url",
        "path": "Extension.extension.url",
        "fixedUri": "created_time"
      },
      {
        "id": "Extension.extension:created_time.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Extension.extension:updated_time",
        "path": "Extension.extension",
        "sliceName": "updated_time",
        "short": "Timestamp of content update in RFC3339, identical to `created_time` in systems that do not support updates.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:updated_time.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:updated_time.url",
        "path": "Extension.extension.url",
        "fixedUri": "updated_time"
      },
      {
        "id": "Extension.extension:updated_time.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Extension.extension:version",
        "path": "Extension.extension",
        "sliceName": "version",
        "short": "A string representing a version. (Some systems may use checksum, a RFC3339 timestamp, or an incrementing version number.)",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:version.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:version.url",
        "path": "Extension.extension.url",
        "fixedUri": "version"
      },
      {
        "id": "Extension.extension:version.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:mime_type",
        "path": "Extension.extension",
        "sliceName": "mime_type",
        "short": "A string providing the mime-type of the `DrsObject`.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:mime_type.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:mime_type.url",
        "path": "Extension.extension.url",
        "fixedUri": "mime_type"
      },
      {
        "id": "Extension.extension:mime_type.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:checksums",
        "path": "Extension.extension",
        "sliceName": "checksums",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-checksum"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.extension:access_methods",
        "path": "Extension.extension",
        "sliceName": "access_methods",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-access-method"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-object"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}
{
  "resourceType": "StructureDefinition",
  "id": "drs-checksum",
  "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-checksum",
  "version": "0.2.1",
  "name": "DRSChecksum",
  "title": "DRS Checksum",
  "status": "active",
  "description": "The checksum of the `DrsObject`. At least one checksum must be provided.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Element"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "min": 2
      },
      {
        "id": "Extension.extension:checksum",
        "path": "Extension.extension",
        "sliceName": "checksum",
        "short": "The hex-string encoded checksum for the data.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:checksum.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:checksum.url",
        "path": "Extension.extension.url",
        "fixedUri": "checksum"
      },
      {
        "id": "Extension.extension:checksum.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:type",
        "path": "Extension.extension",
        "sliceName": "type",
        "short": "The digest method used to create the checksum.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:type.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:type.url",
        "path": "Extension.extension.url",
        "fixedUri": "type"
      },
      {
        "id": "Extension.extension:type.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-checksum"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}
{
  "resourceType": "StructureDefinition",
  "id": "drs-access-method",
  "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-access-method",
  "version": "0.2.1",
  "name": "DRSAccessMethod",
  "title": "DRS AccessMethod",
  "status": "active",
  "description": "The list of access methods that can be used to fetch the `DrsObject`.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Element"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "min": 1
      },
      {
        "id": "Extension.extension:type",
        "path": "Extension.extension",
        "sliceName": "type",
        "short": "Type of the access method.",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:type.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:type.url",
        "path": "Extension.extension.url",
        "fixedUri": "type"
      },
      {
        "id": "Extension.extension:type.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:access_url",
        "path": "Extension.extension",
        "sliceName": "access_url",
        "short": "An `AccessURL` that can be used to fetch the actual object bytes.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:access_url.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:access_url.url",
        "path": "Extension.extension.url",
        "fixedUri": "access_url"
      },
      {
        "id": "Extension.extension:access_url.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:access_id",
        "path": "Extension.extension",
        "sliceName": "access_id",
        "short": "An arbitrary string to be passed to the `/access` method to get an `AccessURL`.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:access_id.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:access_id.url",
        "path": "Extension.extension.url",
        "fixedUri": "access_id"
      },
      {
        "id": "Extension.extension:access_id.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.extension:region",
        "path": "Extension.extension",
        "sliceName": "region",
        "short": "An arbitrary string to be passed to the `/access` method to get an `AccessURL`.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Extension.extension:region.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:region.url",
        "path": "Extension.extension.url",
        "fixedUri": "region"
      },
      {
        "id": "Extension.extension:region.value[x]",
        "path": "Extension.extension.value[x]",
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-access-method"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}

Step 2: Post an Example Resource

{
  "resourceType": "DocumentReference",
  "id": "example-document-reference-id",
  "content": [
    {
      "attachment": {
        "extension": [
          {
            "extension": [
              {
                "url": "id",
                "valueString": "any-id"
              },
              {
                "url": "self_uri",
                "valueString": "drs://url-here"
              },
              {
                "url": "size",
                "valueDecimal": 17734638122
              },
              {
                "url": "created_time",
                "valueDateTime": "1985-04-12T23:20:50.52Z"
              },
              {
                "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-checksum",
                "extension": [
                  {
                    "url": "checksum",
                    "valueString": "abcdef0123456789"
                  },
                  {
                    "url": "type",
                    "valueString": "etag"
                  }
                ]
              },
              {
                "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-access-method",
                "extension": [
                  {
                    "url": "type",
                    "valueString": "s3"
                  },
                  {
                    "url": "access_url",
                    "valueString": "s3://some-url-here"
                  },
                  {
                    "url": "region",
                    "valueString": "us-west"
                  }
                ]
              },
              {
                "url": "name",
                "valueString": "any-file-name"
              },
              {
                "url": "updated_time",
                "valueDateTime": "1985-04-12T23:20:50.52Z"
              },
              {
                "url": "version",
                "valueString": "0.0.0"
              },
              {
                "url": "mime_type",
                "valueString": "application/json"
              }
            ],
            "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-object"
          }
        ],
        "id": "any-attachment-id",
        "contentType": "application/json"
      }
    }
  ],
  "status": "current",
  "identifier": [
    {
      "system": "urn:ncpi:unique-string",
      "value": "example-document-reference-id"
    }
  ]
}

Server Behaviors

Expected Behavior

A 200 or 201 response

Actual Behavior

E               AssertionError: body:{"resourceType": "DocumentReference", "id": "example-document-reference-id", "content": [{"attachment": {"extension": [{"extension": [{"url": "id", "valueString": "any-id"}, {"url": "self_uri", "valueString": "drs://url-here"}, {"url": "size", "valueDecimal": 17734638122}, {"url": "created_time", "valueDateTime": "1985-04-12T23:20:50.52Z"}, {"url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-checksum", "extension": [{"url": "checksum", "valueString": "abcdef0123456789"}, {"url": "type", "valueString": "etag"}]}, {"url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-access-method", "extension": [{"url": "type", "valueString": "s3"}, {"url": "access_url", "valueString": "s3://some-url-here"}, {"url": "region", "valueString": "us-west"}]}, {"url": "name", "valueString": "any-file-name"}, {"url": "updated_time", "valueDateTime": "1985-04-12T23:20:50.52Z"}, {"url": "version", "valueString": "0.0.0"}, {"url": "mime_type", "valueString": "application/json"}], "url": "http://fhir.ncpi-project-forge.io/StructureDefinition/drs-object"}], "id": "any-attachment-id", "contentType": "application/json"}}], "status": "current", "identifier": [{"system": "urn:ncpi:unique-string", "value": "example-document-reference-id"}]}
E                 error: {
E                   "resourceType": "OperationOutcome",
E                   "issue": [ {
E                     "severity": "error",
E                     "code": "processing",
E                     "diagnostics": "Index 0 out of bounds for length 0"
E                   } ]
E                 }
E               assert False
E                +  where False = <Response [500]>.ok
15:30:49.318 [fhir_endpoint.fhirEndpointServer-1901] ERROR c.u.f.r.s.i.ExceptionHandlingInterceptor - Failure during REST processing
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Index 0 out of bounds for length 0
    at ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor.validate(BaseValidatingInterceptor.java:303)
    at ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor.incomingRequestPostProcessed(RequestValidatingInterceptor.java:88)
    at jdk.internal.reflect.GeneratedMethodAccessor351.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at ca.uhn.fhir.interceptor.executor.InterceptorService$HookInvoker.invoke(InterceptorService.java:497) [1 skipped]
    at ca.uhn.fhir.interceptor.executor.InterceptorService.doCallHooks(InterceptorService.java:271)
    at ca.uhn.fhir.interceptor.executor.InterceptorService.callHooks(InterceptorService.java:260)
    at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:990)
    at ca.cdr.endpoint.fhir.web.BaseFhirEndpointServlet.handleRequest(BaseFhirEndpointServlet.java:293)
    at ca.uhn.fhir.rest.server.RestfulServer.doPut(RestfulServer.java:351)
    at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1704)
    at ca.cdr.endpoint.fhir.web.BaseFhirEndpointServlet.service(BaseFhirEndpointServlet.java:445)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at ca.cdr.api.web.BlockVerbsFilter.doFilter(BlockVerbsFilter.java:47) [2 skipped]
    at ca.cdr.api.web.JettyHealthCheckFilterHttpResponses.doFilter(JettyHealthCheckFilterHttpResponses.java:94) [40 skipped]
    at ca.cdr.endpoint.fhir.web.FhirEndpointElasticApmFilter.doFilter(FhirEndpointElasticApmFilter.java:60) [1 skipped]
    at ca.cdr.endpoint.fhir.web.FhirEndpointErrorTrapFilter.doFilter(FhirEndpointErrorTrapFilter.java:44) [1 skipped]
    at ca.cdr.api.web.ExceptionLoggerFilter.doFilter(ExceptionLoggerFilter.java:47) [1 skipped]
    at ca.cdr.api.web.DefaultResourcesFilter.doFilter(DefaultResourcesFilter.java:56) [1 skipped]
    at ca.cdr.api.security.SaveModuleInRequestFilter.doFilter(SaveModuleInRequestFilter.java:60) [1 skipped]
    at ca.cdr.api.web.IgnoreInvalidAuthorizationHeaderFilter.doFilter(IgnoreInvalidAuthorizationHeaderFilter.java:50) [1 skipped]
    at ca.cdr.api.web.ClearSecurityFilter.doFilter(ClearSecurityFilter.java:22) [1 skipped]
    at ca.cdr.api.web.HttpTroubleshootingLogFilter.doFilter(HttpTroubleshootingLogFilter.java:74) [1 skipped]
    at java.base/java.lang.Thread.run(Thread.java:834) [25 skipped]
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
    at java.base/java.util.Objects.checkIndex(Objects.java:372)
    at java.base/java.util.ArrayList.get(ArrayList.java:458)
    at org.hl7.fhir.r4.conformance.ProfileUtilities.updateFromDefinition(ProfileUtilities.java:1683)
    at org.hl7.fhir.r4.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1055)
    at org.hl7.fhir.r4.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:628)
    at org.hl7.fhir.r4.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:454)
    at org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport.generateSnapshot(SnapshotGeneratingValidationSupport.java:66)
    at org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain.generateSnapshot(ValidationSupportChain.java:65)
    at org.hl7.fhir.common.hapi.validation.support.BaseValidationSupportWrapper.generateSnapshot(BaseValidationSupportWrapper.java:93)
    at org.hl7.fhir.common.hapi.validation.validator.VersionSpecificWorkerContextWrapper.lambda$new$0(VersionSpecificWorkerContextWrapper.java:88)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalLoadingCache.lambda$new$0(BoundedLocalCache.java:3308)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2031)
    at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1947)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2029)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2012)
    at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:113)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:65)
    at org.hl7.fhir.common.hapi.validation.validator.VersionSpecificWorkerContextWrapper.fetchResource(VersionSpecificWorkerContextWrapper.java:267)
    at org.hl7.fhir.validation.instance.InstanceValidator.checkExtension(InstanceValidator.java:1404)
    at org.hl7.fhir.validation.instance.InstanceValidator.checkChild(InstanceValidator.java:4818)
    at org.hl7.fhir.validation.instance.InstanceValidator.validateElement(InstanceValidator.java:4666)
    at org.hl7.fhir.validation.instance.InstanceValidator.checkChild(InstanceValidator.java:4915)
    at org.hl7.fhir.validation.instance.InstanceValidator.validateElement(InstanceValidator.java:4666)
    at org.hl7.fhir.validation.instance.InstanceValidator.checkChild(InstanceValidator.java:4840)
    at org.hl7.fhir.validation.instance.InstanceValidator.validateElement(InstanceValidator.java:4666)
    at org.hl7.fhir.validation.instance.InstanceValidator.startInner(InstanceValidator.java:3468)
    at org.hl7.fhir.validation.instance.InstanceValidator.start(InstanceValidator.java:3381)
    at org.hl7.fhir.validation.instance.InstanceValidator.validateResource(InstanceValidator.java:5358)
    at org.hl7.fhir.validation.instance.InstanceValidator.validate(InstanceValidator.java:694)
    at org.hl7.fhir.validation.instance.InstanceValidator.validate(InstanceValidator.java:548)
    at org.hl7.fhir.common.hapi.validation.validator.ValidatorWrapper.validate(ValidatorWrapper.java:165)
    at org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator.validate(FhirInstanceValidator.java:301)
    at org.hl7.fhir.common.hapi.validation.validator.BaseValidatorBridge.doValidate(BaseValidatorBridge.java:22)
    at org.hl7.fhir.common.hapi.validation.validator.BaseValidatorBridge.validateResource(BaseValidatorBridge.java:45)
    at org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator.validateResource(FhirInstanceValidator.java:30)
    at ca.uhn.fhir.validation.FhirValidator.validateWithResult(FhirValidator.java:245)
    at ca.uhn.fhir.validation.FhirValidator.validateWithResult(FhirValidator.java:200)
    at ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor.doValidate(RequestValidatingInterceptor.java:69)
    at ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor.doValidate(RequestValidatingInterceptor.java:50)
    at ca.uhn.fhir.rest.server.interceptor.BaseValidatingInterceptor.validate(BaseValidatingInterceptor.java:294)
    ... 99 common frames omitted
znatty22 commented 4 years ago

cc @liberaliscomputing

ShahimEssaid commented 4 years ago

From slack:

Shahim Essaid 12:17 PM Still not sure but the problem appears to be with generating the snapshot for one of the StructureDefinitions. See this this part of the exception stack 12:17 at java.base/java.util.ArrayList.get(ArrayList.java:458) at org.hl7.fhir.r4.conformance.ProfileUtilities.updateFromDefinition(ProfileUtilities.java:1683) at org.hl7.fhir.r4.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:1055) at org.hl7.fhir.r4.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:628) at org.hl7.fhir.r4.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:454) at org.hl7.fhir.common.hapi.validation.support.SnapshotGeneratingValidationSupport.generateSnapshot(SnapshotGeneratingValidationSupport.java:66) at org.hl7.fhir.common.hapi.validation.support.ValidationSupportChain.generateSnapshot(ValidationSupportChain.java:65)

12:18 i'll have to look carefully through the profiles to see what's missing there. check to see if all the paths being referenced, the nesting, etc. is correct. 12:19 i'm guessing there is something wrong with path references to paths that are supposed to exist in the base definition

Walsbr 12:19 PM much appreciated. thank you! (edited)

Shahim Essaid 12:20 PM to help debug this (unless you can do remote JVM debugging) is to gradually build up your instance example to use one extension profile at a time until you hit the problematic one 12:20 otherwise you 12:20 you're not sure which one it is 12:21 so, loosen your cardinality restrictions and then use one nested extension at a time. 12:21 once the profiles are working, go back and reapply your cardinalities 12:22 but carefully double check your paths in your profiles 12:22 one way is to get the base definitions you're using and make sure your paths match something in the base