func (resource *PlanDefinition) MarshalJSON() ([]byte, error) {
	resource.ResourceType = "PlanDefinition"
	return json.Marshal(*resource)
}
Custom marshaller to add the resourceType property, as required by the specification
package models
import (
	"encoding/json"
	"errors"
	"fmt"
)
type PlanDefinition struct {
	DomainResource   `bson:",inline"`
	Url              string                                    `bson:"url,omitempty" json:"url,omitempty"`
	Identifier       []Identifier                              `bson:"identifier,omitempty" json:"identifier,omitempty"`
	Version          string                                    `bson:"version,omitempty" json:"version,omitempty"`
	Name             string                                    `bson:"name,omitempty" json:"name,omitempty"`
	Title            string                                    `bson:"title,omitempty" json:"title,omitempty"`
	Type             *CodeableConcept                          `bson:"type,omitempty" json:"type,omitempty"`
	Status           string                                    `bson:"status,omitempty" json:"status,omitempty"`
	Experimental     *bool                                     `bson:"experimental,omitempty" json:"experimental,omitempty"`
	Description      string                                    `bson:"description,omitempty" json:"description,omitempty"`
	Purpose          string                                    `bson:"purpose,omitempty" json:"purpose,omitempty"`
	Usage            string                                    `bson:"usage,omitempty" json:"usage,omitempty"`
	PublicationDate  *FHIRDateTime                             `bson:"publicationDate,omitempty" json:"publicationDate,omitempty"`
	LastReviewDate   *FHIRDateTime                             `bson:"lastReviewDate,omitempty" json:"lastReviewDate,omitempty"`
	EffectivePeriod  *Period                                   `bson:"effectivePeriod,omitempty" json:"effectivePeriod,omitempty"`
	Coverage         []UsageContext                            `bson:"coverage,omitempty" json:"coverage,omitempty"`
	Topic            []CodeableConcept                         `bson:"topic,omitempty" json:"topic,omitempty"`
	Contributor      []Contributor                             `bson:"contributor,omitempty" json:"contributor,omitempty"`
	Publisher        string                                    `bson:"publisher,omitempty" json:"publisher,omitempty"`
	Contact          []ContactDetail                           `bson:"contact,omitempty" json:"contact,omitempty"`
	Copyright        string                                    `bson:"copyright,omitempty" json:"copyright,omitempty"`
	RelatedResource  []RelatedResource                         `bson:"relatedResource,omitempty" json:"relatedResource,omitempty"`
	Library          []Reference                               `bson:"library,omitempty" json:"library,omitempty"`
	ActionDefinition []PlanDefinitionActionDefinitionComponent `bson:"actionDefinition,omitempty" json:"actionDefinition,omitempty"`
}