public static function fromFhir($fhirObject) { $resourceType = static::getFhirType(); if ($fhirObject->resourceType != $resourceType) { throw new InvalidStructure("Expecting a resource of type '{$resourceType}', got '{$fhirObject->resourceType}'"); } return parent::fromFhir($fhirObject); }