text:
<?php

/**
 * @author marcus@silverstripe.com.au
 * @license BSD License http://silverstripe.org/bsd-license/
 */
class MicroPost extends DataObject { /* implements Syncroable { */
	private static $db = array(
		'Title'				=> 'Varchar(255)',
		'Content'			=> 'Text',
		'RenderedContent'	=> 'Text',
		'Author'			=> 'Varchar(255)',
		'OriginalLink'		=> 'Varchar',
		'OriginalContent'	=> 'Text',
		'IsOembed'			=> 'Boolean',
		'Deleted'			=> 'Boolean',
		'NumReplies'		=> 'Int',
		'Target'			=> 'Varchar',		// ClassName,ID
		'PostType'			=> 'Varchar',
	);

	private static $has_one = array(
		'ThreadOwner'	=> 'Member',			// owner of the thread this is in
		'Parent'		=> 'MicroPost',
		'Thread'		=> 'MicroPost',
		'Attachment'	=> 'File',

		'PermSource'	=> 'PermissionParent',
	);

	private static $has_many = array(
		'Replies'		=> 'MicroPost.Parent',
	);

	private static $defaults = array(
		'PublicAccess'		=> false,
		'InheritPerms'		=> true,		// we'll have  default container set soon
	);

	private static $extensions = array(
		'Rateable',
		'Restrictable',
		'TaggableExtension',
	);

	private static $summary_fields = array(
		'PostTitle',
		'Author',
		'PostSummary',
		'Created'
	);

	private static $searchable_fields = array(
		'Title',
		'Content'
	);

	private static $default_sort = 'ID DESC';

	/**
	 * Do we automatically detect oembed data and change comments?
	 *
	 * Override using injector configuration
	 *
	 * @var boolean
	 */
	public $oembedDetect = true;

	/**
	 * @var SocialGraphService
	 */
	public $socialGraphService;

	/**
	 * @var MicroBlogService
	 */
	public $microBlogService;

	/**
	 * @var SecurityContext
	 */
	public $securityContext;

	/**
	 * @var PermissionService
	 */
	public $permissionService;

	/**
	 * @var SyncrotronService
	 */
	public $syncrotronService;

	private $afterWriteRender = false;

	public function onBeforeWrite() {
		$member = $this->securityContext->getMember();
		if (!$this->ThreadOwnerID) {
			if ($this->ParentID) {
				$this->ThreadOwnerID = $this->Parent()->ThreadOwnerID;
			} else {
				$this->ThreadOwnerID = $member->ID;
			}
		}

		if (!$this->Author) {
			$this->Author = $this->securityContext->getMember()->getTitle();
		}

		if ($this->AttachmentID && strlen($this->Content) == 0) {
			$attachment = $this->Attachment();
			$link = '';
			if ($attachment instanceof Image) {
				$scaled = $attachment->MaxWidth(1024);
				$link = $scaled->Link();
				$this->Content = '![' . $attachment->Title .'](' . $link.')';
			} else {
				$link = $attachment->Link();
				$this->Content = '[' . $attachment->Title .'](' . $link.')';
			}
		}

		if (!$this->Title) {
			if ($this->AttachmentID) {
				$this->Title = basename($this->Attachment()->Filename);
			} else {
				$this->Title = str_replace("\n", " ", $this->socialGraphService->extractTitle($this->Content));
			}
		}
		parent::onBeforeWrite();

		if ($this->ID) {
			$this->RenderedContent = $this->renderWith('PostContent')->raw();
		} else {
			$this->afterWriteRender = true;
		}
	}

	public function onAfterWrite() {
		parent::onAfterWrite();
		if ($this->afterWriteRender) {
			$this->afterWriteRender = false;
			$this->write();
		}
	}

	/**
	 * Gives access to this micropost, based on information in the $to array
	 *
	 * @param array $to
	 *			The people/groups this post is being sent to. This is an array of
	 *			- logged_in: boolean (logged in users; uses a system config setting to determine which group represents 'logged in'
	 *			- members: an array, or comma separated string, of member IDs
	 *			- groups: an array, or comma separated string, of group IDs
	 */
	public function giveAccessTo($to) {
		if ($to) {
			$grantTo = array();
			if (isset($to['logged_in']) && $to['logged_in']) {
				// find the 'logged in' group, and grant to that.
				$groups = null;
				if (class_exists('Multisites')) {
					$groups = Multisites::inst()->getCurrentSite()->LoggedInGroups()->toArray();
				} else {
					$groups = SiteConfig::current_site_config()->LoggedInGroups()->toArray();
				}
				if ($groups) {
					$grantTo = array_merge($grantTo, $groups);
				}
			}
			// todo evaluate security implication of posting to arbitrary members...
			// do we need to check 'friends' status here?
			if (isset($to['members']) && count($to['members'])) {
				if (!is_array($to['members'])) {
					$to['members'] = explode(',', $to['members']);
				}
				foreach ($to['members'] as $memberId) {
					$id = (int) $memberId;
					$toMember = Member::get()->byID($id);
					if ($toMember) {
						$grantTo[] = $toMember;
					}
				}
			}

			if (isset($to['groups']) && count($to['groups'])) {
				if (!is_array($to['groups'])) {
					$to['groups'] = explode(',', $to['groups']);
				}
				foreach ($to['groups'] as $groupId) {
					$groupId = (int) $groupId;
					$group = Group::get()->byID($groupId);
					if ($group) {
						$grantTo[] = $group;
					}
				}
			}

			if (count($grantTo)) {
				foreach ($grantTo as $grantee) {
					$this->permissionService->grant($this, 'View', $grantee);
				}
			}

			// what about to the public?
			if (isset($to['public'])) {
				$this->PublicAccess = true;
				$this->write();
			}
		}
	}

	/**
	 * Has this post been read by the given user?
	 *
	 * @param Member $member
	 * @return boolean
	 */
	public function isUnreadByUser($member = null) {
		if (!$member) {
			$member = $this->securityContext->getMember();
		}

		if ($member && $member->ID) {
			return strtotime($this->Created) > strtotime($member->LastPostView);
		}
	}

	/**
	 * has this post been edited? return 'true' if the diff between created and last edited
	 * is greater than a 'grace' period.
	 */
	public function isEdited($grace = 300) {
		return (strtotime($this->LastEdited) - strtotime($this->Created)) > $grace;
	}

	/**
	 * Get a summary of the post
	 *
	 * @return string
	 */
	public function PostSummary() {
		return $this->obj('Content')->ContextSummary(40, 'poweapfawepofj');
	}

	/**
	 * Returns the title of this post (trimmed down in length for sanity)
	 *
	 * @return string
	 */
	public function PostTitle() {
		return $this->obj('Title')->LimitCharacters(40, 'afwef');
	}

	/**
	 * Get the content of this post with hash-tags converted to links
	 *
	 * @return string
	 */
	public function ConvertedContent() {
		$content = $this->Content;
		if (preg_match_all('/#([a-z0-9_-]+)/is', $content, $matches)) {

			foreach ($matches[1] as $tag) {
				$link = Controller::join_links(TimelineController::URL_SEGMENT, '?tags=' . urlencode($tag));
				$content = str_replace('#' . $tag, "[\\#$tag]($link)", $content);
			}
		}
		return DBField::create_field('Text', $content);
	}

	public function getPostTarget() {
		if ($this->Target && strpos($this->Target, ',')) {
			list($type, $id) = explode(',', $this->Target);
			$item = DataList::create($type)->restrictedByID($id);
			return $item;
		}
	}

	public function currentContext() {
		$tgt = Controller::curr()->getRequest()->getVar('target');
		return strlen($tgt) > 0 && $this->Target == $tgt;
	}

	/**
	 * Get the list of members mentioned in this post
	 */
	public function mentionedMembers() {
		$members = array();
		if (preg_match_all('/@(.*?):(\d+)/', $this->Content, $matches)) {
			foreach ($matches[2] as $match) {
				$member = Member::get()->byID((int) $match);
				if ($member && $member->ID) {
					$members[] = $member;
				}
			}
		}
		return $members;
	}

	/**
	 * Handle the wilson rating specially
	 *
	 * @param type $field
	 * @return string
	 */
	public function hasOwnTableDatabaseField($field) {
		if ($field == 'WilsonRating') {
			return "Double";
		}
		if ($field == 'ActiveRating') {
			return "Int";
		}
		if ($field == 'PositiveRating') {
			return "Int";
		}
		return parent::hasOwnTableDatabaseField($field);
	}

	/**
	 * Is this post an image?
	 *
	 * @return boolean
	 */
	public function IsImage() {
		return $this->socialGraphService->isImage($this->Content);
	}

	/**
	 * Check contents of the post for things like tags, user references, external
	 * references etc.
	 */
	public function analyseContent() {
		$this->microBlogService->extractTags($this);
		$this->socialGraphService->convertPostContent($this);
	}

	/**
	 * Tag this post with a particular tag
	 *
	 * @param string $tag
	 */
	public function tag($tags, $clearExisting = false) {
		if (!is_array($tags)) {
			$tags = array($tags);
		}

		if ($clearExisting) {
			$this->Tags()->removeAll();
		}

		$created = array();
		foreach ($tags as $tag) {
			if (!preg_match('/[a-z0-9_-]/i', $tag)) {
				continue;
			}
			$existing = PostTag::get()->filter(array('Title' => $tag))->first();
			if (!$existing) {
				$existing = PostTag::create();
				$existing->Title = $tag;
				$existing->write();
			}
			$this->Tags()->add($existing, array('Tagged' => date('Y-m-d H:i:s')));
			$created[] = $existing;
		}
		return $created;
	}

	/**
	 * Gets the list of current votes on this object by the current user
	 *
	 * @param Member $user
	 *
	 * @return ArrayList
	 */
	public function currentVotesByUser($user = null) {
		if (!$user) {
			$user = $this->securityContext->getMember();
		}
		$votes = MicroPostVote::get()->filter(array('UserID' => $user->ID, 'PostID' => $this->ID));
		return $votes->toArray();
	}

	/**
	 * When 'deleting' an object, we actually just remove all its content
	 */
	public function delete() {
		$this->RenderedContent = '';
		if ($this->checkPerm('Delete')) {
			$this->Tags()->removeAll();
			// if we have replies, we can't delete completely!
			if ($this->Replies()->exists() && $this->Replies()->count() > 0) {
				$count = $this->Replies()->count();
				$item = $this->Replies()->first();
				$this->Deleted = true;
				$this->Content = _t('MicroPost.DELETED', '[deleted]');
				$this->Author = $this->Content;
				$this->write();
			} else {
				return parent::delete();
			}
		}
	}

	/**
	 * handles SiteTree::canAddChildren, useful for other types too
	 */
	public function canAddChildren() {
		if ($this->checkPerm('View')) {
			return true;
		} else {
			return false;
		}
	}

	public function formattedPost() {
		return Convert::raw2xml($this->Content);
	}

	public function Link() {
		$additional = '';
		if (strlen($this->Title)) {
			$additional = str_replace('.', '-', URLSegmentFilter::create()->filter($this->Title));
		}

		$curr = Controller::curr();

		if ($curr && $curr instanceof TimelineController) {
			return $curr->Link('show/' . $this->ID . '/' . $additional);
		}

		return 'timeline/show/' . $this->ID . '/' . $additional;
	}

	public function ThreadLink() {
		if ($this->ThreadID != $this->ID) {
			return $this->Thread()->Link();
		}
		return $this->Link();
	}

	public function AbsoluteThreadLink() {
		return Director::absoluteURL($this->ThreadLink());
	}

	public function AbsoluteLink() {
		return Director::absoluteURL($this->Link());
	}

	/**
	 * Gets all the replies to this post
	 *
	 * @return ArrayList
	 */
	public function Posts() {
		return $this->microBlogService->getRepliesTo($this);
	}

	/**
	 * We need to define a  permission source to ensure the
	 * ParentID isn't used for permission inheritance
	 */
	public function permissionSource() {
		if ($this->ParentID) {
			return $this->Parent();
		}
		if ($this->PermSourceID) {
			return $this->PermSource();
		}

		if ($this->ID && $this->Target && strpos($this->Target, ',')) {
			list($type, $id) = explode(',', $this->Target);
			$item = DataList::create($type)->byID($id);
			if ($item) {
				return $item;
			}
		}
	}

	/**
	 * Get a list of all the members who should receive notifications based on the
	 * notificationType variable
	 *
	 * @param string $notificationType
	 *				The notification type being sent
	 * @return array
	 */
	public function getRecipients($notificationType) {
		switch ($notificationType) {
			case 'MICRO_POST_CREATED': {
				$members = $this->mentionedMembers();
				return $members;
			}
		}
	}

	/**
	 * Return a list of available keywords in the format
	 * array('keyword' => 'A description') to help users format notification fields
	 * @return array
	 */
	public function getAvailableKeywords() {
		return array(
			'Content'		=> 'Raw content of the post',
			'HTMLContent'	=> 'Rendered HTML of the post content',
			'Title'			=> 'Title of the post (if set)',
			'Link'			=> 'Relative link to the individual post',
			'AbsoluteLink'	=> 'Absolute link to the individual post',
			'ThreadLink'	=> 'Relative link to the thread containing the post',
			'AbsoluteThreadLink'	=> 'Absolute link to the thread containing the post'
		);
	}

	/**
	 * Gets an associative array of data that can be accessed in
	 * notification fields and templates
	 * @return array
	 */
	public function getNotificationTemplateData() {
		return array(
			'Content'		=> $this->Content,
			'HTMLContent'	=> $this->ConvertedContent(),
			'Title'			=> $this->Title,
			'Link'			=> $this->Link(),
			'AbsoluteLink'	=> $this->AbsoluteLink(),
			'ThreadLink'	=> $this->ThreadLink(),
			'AbsoluteThreadLink'	=> $this->AbsoluteThreadLink(),
		);
	}

	public function forSyncro() {
		$props = $this->syncrotronService->syncroObject($this);
		unset($props['PermSourceID']);

		$props['Post_ThreadEmail'] = $this->ThreadOwner()->Email;
		$props['Post_OwnerEmail'] = $this->Owner()->Email;

		return $props;
	}

	public function fromSyncro($properties) {
		$this->syncrotronService->unsyncroObject($properties, $this);

		// now make sure the other things are aligned
		if (isset($properties->Post_ThreadEmail)) {
			$member = DataList::create('Member')->filter(array('Email' => $properties->Post_ThreadEmail))->first();
			if ($member) {
				$this->ThreadOwnerID = $member->ID;
			}
		}

		if (isset($properties->Post_OwnerEmail)) {
			$member = DataList::create('Member')->filter(array('Email' => $properties->Post_OwnerEmail))->first();
			if ($member) {
				$this->OwnerID = $member->ID;
			}
		}

		// bind the correct permission source
		$this->permissionSource();
	}
}


text:
#ifndef HTMLBaseElement_h
#define HTMLBaseElement_h

#include "HTMLElement.h"

namespace WebCore {

class HTMLBaseElement : public HTMLElement {
public:
    static PassRefPtr<HTMLBaseElement> create(const QualifiedName&, Document*);

private:
    HTMLBaseElement(const QualifiedName&, Document*);

    virtual String target() const;
    virtual bool isURLAttribute(Attribute*) const;
    virtual void parseMappedAttribute(Attribute*);
    virtual void insertedIntoDocument();
    virtual void removedFromDocument();
};

} // namespace

#endif

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.WebPages;
using CommonServiceLocator;
using Microsoft.Practices.Unity.Configuration;
using Sdl.Web.Common.Configuration;
using Sdl.Web.Common.Logging;
using Sdl.Web.Mvc.Configuration;
using Sdl.Web.Mvc.Context;
using Sdl.Web.Mvc.Formats;
using Sdl.Web.Mvc.Html;
using Unity;
using Unity.Mvc5;
using Unity.ServiceLocation;
using Sdl.Web.Common.Models;

namespace Sdl.Web.Site
{
    public class MvcApplication : HttpApplication
    {
        private static bool _initialized;

        public static void RegisterRoutes(RouteCollection routes)
        {
            // Some URLs should not be handled by any Controller:
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            string cidUrlPath = ContextualMediaHelper.GetCidPath;
            if (!string.IsNullOrEmpty(cidUrlPath))
            {
                // If cid-service-proxy-pattern is configured:
                routes.IgnoreRoute(cidUrlPath + "/{*pathInfo}");
            }
            string ignoreUrls = WebConfigurationManager.AppSettings["ignore-urls"];
            if (!string.IsNullOrEmpty(ignoreUrls))
            {
                // If additional URLs to be ignored are configured (e.g. XO Experiment Tracking):
                foreach (string ignoreUrl in ignoreUrls.Split(';'))
                {
                    routes.IgnoreRoute(ignoreUrl + "/{*pathInfo}");
                }
            }

            routes.MapMvcAttributeRoutes();

            // XPM blank page
            routes.MapRoute(
                "Core_Blank",
                "se_blank.html",
                new {controller = "Page", action = "Blank"}
                ).DataTokens.Add("area", "Core");

            // Navigation JSON
            routes.MapRoute(
                "Core_Navigation",
                "navigation.json",
                new {controller = "Navigation", action = "SiteMapJson"}
                ).DataTokens.Add("area", "Core");
            routes.MapRoute(
                "Core_Navigation_loc",
                "{localization}/navigation.json",
                new {controller = "Navigation", action = "SiteMapJson"}
                ).DataTokens.Add("area", "Core");

            // Google Site Map
            routes.MapRoute(
                "Core_Sitemap",
                "sitemap.xml",
                new {controller = "Navigation", action = "SiteMapXml"}
                ).DataTokens.Add("area", "Core");
            routes.MapRoute(
                "Core_Sitemap_Loc",
                "{localization}/sitemap.xml",
                new {controller = "Navigation", action = "SiteMapXml"}
                ).DataTokens.Add("area", "Core");

            // Navigation subtree
            routes.MapRoute(
                "NavSubtree",
                "api/navigation/subtree/{sitemapItemId}",
                new {controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional}
                );
            routes.MapRoute(
                "NavSubtree_Loc",
                "{localization}/api/navigation/subtree/{sitemapItemId}",
                new {controller = "Navigation", action = "GetNavigationSubtree", sitemapItemId = UrlParameter.Optional}
                );

            // For resolving ids to urls
            routes.MapRoute(
                "Core_Resolve",
                "resolve/{*itemId}",
                new {controller = "Page", action = "Resolve"},
                new {itemId = @"^(.*)?$"}
                ).DataTokens.Add("area", "Core");
            routes.MapRoute(
                "Core_Resolve_Loc",
                "{localization}/resolve/{*itemId}",
                new {controller = "Page", action = "Resolve"},
                new {itemId = @"^(.*)?$"}
                ).DataTokens.Add("area", "Core");

            // Admin actions
            string enable = WebConfigurationManager.AppSettings["admin.refresh.enabled"];
            if (!String.IsNullOrEmpty(enable) && enable.Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                routes.MapRoute(
                    "Core_Admin",
                    "admin/{action}",
                    new {controller = "Admin", action = "Refresh"}
                    );
                routes.MapRoute(
                    "Core_Admin_Loc",
                    "{localization}/admin/{action}",
                    new {controller = "Admin", action = "Refresh"}
                    );
            }

            // Tridion Page Route
            routes.MapRoute(
                "Core_Page",
                "{*pageUrl}",
                new {controller = "Page", action = "Page"},
                new {pageId = @"^(.*)?$"}
                ).DataTokens.Add("area", "Core");

        }

        protected void Application_Start()
        {
            InitializeDependencyInjection();
            SiteConfiguration.InitializeProviders(DependencyResolver.Current.GetService);

            DataFormatters.Formatters.Add("json", new JsonFormatter());
            DataFormatters.Formatters.Add("rss", new RssFormatter());
            DataFormatters.Formatters.Add("atom", new AtomFormatter());

            RegisterRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();
            GenericTopic.Register(); // Register generic Topic View Model so that Tridion Docs content can be handled.
            RegisterDisplayModes();
            _initialized = true;
        }

        protected void RegisterDisplayModes()
        {
            IList<IDisplayMode> displayModes = DisplayModeProvider.Instance.Modes;
            foreach (string deviceFamily in ContextEngine.DeviceFamilies)
            {
                displayModes.Insert(
                    1,
                    new DefaultDisplayMode(deviceFamily) { ContextCondition = (ctx => WebRequestContext.ContextEngine.DeviceFamily == deviceFamily) }
                    );
            }
        }

        protected IUnityContainer InitializeDependencyInjection()
        {
            IUnityContainer container = BuildUnityContainer();
            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
            return container;
        }

        protected IUnityContainer BuildUnityContainer()
        {
            UnityConfigurationSection section = (UnityConfigurationSection)System.Configuration.ConfigurationManager.GetSection("unity");
            IUnityContainer container = section.Configure(new UnityContainer(), "main");
            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(container));
            return container;
        }

        protected void Application_Error(object sender, EventArgs e)
        {
            if (Context.IsCustomErrorEnabled && _initialized)
            {
                ShowCustomErrorPage(Server.GetLastError());
            }
        }

        private void ShowCustomErrorPage(Exception exception)
        {
            HttpException httpException = exception as HttpException;
            if (httpException == null)
            {
                httpException = new HttpException(500, "Internal Server Error", exception);
            }

            RouteData routeData = new RouteData();
            Log.Error(httpException);
            routeData.Values.Add("controller", "Page");
            routeData.Values.Add("area", "Core");
            routeData.Values.Add("action", "ServerError");
            Server.ClearError();
            IController controller = new Sdl.Web.Mvc.Controllers.PageController();
            controller.Execute(new RequestContext(new HttpContextWrapper(Context), routeData));
        }
    }
}


text:
<link rel="import" href="Scripts/polymer.html">

<dom-module id="employee-list">

  <template>

Name: [[test]]

 Employee list:

    <template is="dom-repeat" items="{{employees}}">

First name: [[item.first]]

Last name: [[item.last]]

    </template>

  </template>

   <link href="employee-list.ts" rel="design-time" />

</dom-module>


text:
package com.swfarm.biz.aliexpress.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.swfarm.biz.aliexpress.job.SynchronizeAliExpressItemDetailsTask;
import com.swfarm.biz.aliexpress.srv.AliExpressQueryService;
import com.swfarm.biz.aliexpress.srv.AliExpressService;

public class SynchronizeAliExpressItemDetailsController extends AbstractController {

	private AliExpressService aliExpressService;

	private AliExpressQueryService aliExpressQueryService;

	public void setAliExpressService(AliExpressService aliExpressService) {
		this.aliExpressService = aliExpressService;
	}

	public void setAliExpressQueryService(AliExpressQueryService aliExpressQueryService) {
		this.aliExpressQueryService = aliExpressQueryService;
	}

	protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse res) throws Exception {
		logger.warn("*********start to synchronize aliexpress item details*********");
		SynchronizeAliExpressItemDetailsTask synchronizeAliExpressItemDetailsTask = new SynchronizeAliExpressItemDetailsTask();
		synchronizeAliExpressItemDetailsTask.setAliExpressQueryService(aliExpressQueryService);
		synchronizeAliExpressItemDetailsTask.setAliExpressService(aliExpressService);
		synchronizeAliExpressItemDetailsTask.pullItems();
		logger.warn("*********finish synchronize aliexpress item details***********");
		return new ModelAndView("redirect:/aliexpress/search_aliexpressitems.shtml");
	}

}


text:
from kaio import Options

opts = Options()

def get(value, default):
    return opts.get(value, default, section='Security')

class SecurityMixin(object):
    """
    Security base settings
    """

    @property
    def SECRET_KEY(self):
        return get('SECRET_KEY', u'sysadmin, change the secret key!!!!')

    @property
    def ALLOWED_HOSTS(self):
        return [h.strip() for h in get('ALLOWED_HOSTS', '*').split(',') if h]

    @property
    def SECURE_PROXY_SSL_HEADER_NAME(self):
        return get('SECURE_PROXY_SSL_HEADER_NAME', 'HTTP_X_FORWARDED_PROTO')

    @property
    def SECURE_PROXY_SSL_HEADER_VALUE(self):
        return get('SECURE_PROXY_SSL_HEADER_VALUE', 'https')

    @property
    def SECURE_PROXY_SSL_HEADER(self):
        # required in order to have the request.is_secure() method to work properly in https environments
        # https://docs.djangoproject.com/en/1.10/ref/settings/#secure-proxy-ssl-header
        # SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
        return self.SECURE_PROXY_SSL_HEADER_NAME, self.SECURE_PROXY_SSL_HEADER_VALUE


text:
<?xml version="1.0" encoding="UTF-8"?>

<Profile xmlns="http://hl7.org/fhir">
  <text>
    <status value="generated"/>

<MedicationPrescription xmlns="http://hl7.org/fhir">
 <!-- from Resource: extension, modifierExtension, language, text, and contained -->
 <identifier><!-- 0..* Identifier External identifier --></identifier>
 <dateWritten value="[dateTime]"/><!-- 0..1 Prescription date -->
 <status value="[code]"/><!-- 0..1 active | on hold | completed | entered in error | stopped | superceded -->
 <patient><!-- 0..1 Resource(Patient) Patient --></patient>
 <prescriber><!-- 0..1 Resource(Practitioner) Prescriber --></prescriber>
 <encounter><!-- 0..1 Resource(Encounter) Encounter / Admission / Stay --></encounter>
 <reasonForPrescribing><!-- 0..1 CodeableConcept
     Reason or indication for writing the prescription --></reasonForPrescribing>
 <medication><!-- 0..1 Resource(Medication) Medication to be taken --></medication>
 <dosageInstruction>  <!-- 0..* Dosage instructions -->
  <dosageInstructionsText value="[string]"/><!-- 0..1 Dosage text -->
  <additionalInstructions><!-- 0..1 CodeableConcept
      Additional dosage instructions --></additionalInstructions>
  <timing[x]><!-- 0..1 dateTime|Period|Schedule Medication timing --></timing[x]>
  <site><!-- 0..1 CodeableConcept Entry site --></site>
  <route><!-- 0..1 CodeableConcept Route of administration --></route>
  <method><!-- 0..1 CodeableConcept Administration method --></method>
  <doseQuantity><!-- 0..1 Quantity Dose quantity per dose --></doseQuantity>
  <rate><!-- 0..1 Ratio Dose quantity per unit of time --></rate>
  <maxDosePerPeriod><!-- 0..1 Ratio
      Total dose that should be consumed per unit of time --></maxDosePerPeriod>
 </dosageInstruction>
 <dispense>  <!-- 0..1 Dispense request -->
  <medication><!-- 0..1 Resource(Medication) Medication to be dispensed --></medication>
  <<a title="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription)
It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations.
Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription." class="dict" href="medicationprescription-definitions.html#MedicationPrescription.dispense.validityPeriod">validityPeriod><!-- 0..1 Period Validity period --></validityPeriod>
  <numberOfRepeatsAllowed value="[integer]"/><!-- 0..1 Number of repeats allowed -->
  <quantity><!-- 0..1 Quantity Quanity --></quantity>
  <<a title="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.
In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued. E.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors." class="dict" href="medicationprescription-definitions.html#MedicationPrescription.dispense.expectedSupplyDuration">expectedSupplyDuration><!-- 0..1 Duration Expected supply duration --></expectedSupplyDuration>
 </dispense>
 <substitution>  <!-- 0..1 Deals with substitution of one medicine for another -->
  <type><!-- 1..1 CodeableConcept Type of substitiution --></type>
  <reason><!-- 0..1 CodeableConcept Why should substitution (not) be made --></reason>
 </substitution>
</MedicationPrescription>

  </text>
  <name value="medicationprescription"/>
  <publisher value="FHIR Project"/>
  <description value="Basic Profile. An order for both supply of the medication and the instructions for administration of the medicine to a patient."/>
  <status value="draft"/>
  <date value="2013-12-18"/>
  <mapping>
    <identity value="rim"/>
    <uri value="http://hl7.org/v3"/>
    <name value="RIM"/>
  </mapping>
  <mapping>
    <identity value="v2"/>
    <uri value="http://hl7.org/v2"/>
    <name value="HL7 v2"/>
  </mapping>
  <structure>
    <type value="MedicationPrescription"/>
    <publish value="true"/>
    <element>
      <path value="MedicationPrescription"/>
      <definition>
        <short value="Prescription of medication to for patient"/>
        <formal value="An order for both supply of the medication and the instructions for administration of the medicine to a patient."/>
        <min value="1"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.modifierExtension"/>
      <definition>
        <short value="Extensions that cannot be ignored"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.text"/>
      <definition>
        <short value="Text summary of the resource, for human interpretation"/>
        <formal value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety."/>
        <comments value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative."/>
        <synonym value="narrative"/>
        <synonym value="html"/>
        <synonym value="xhtml"/>
        <synonym value="display"/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.contained"/>
      <definition>
        <short value="Contained, inline Resources"/>
        <formal value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."/>
        <comments value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again."/>
        <synonym value="inline resources"/>
        <synonym value="anonymous resources"/>
        <synonym value="contained resources"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.identifier"/>
      <definition>
        <short value="External identifier"/>
        <formal value="External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created.  This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system."/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="true"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.id"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="ORC-2-Placer Order Number / ORC-3-Filler Order Number"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.identifier.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dateWritten"/>
      <definition>
        <short value="Prescription date"/>
        <formal value="The date (and perhaps time) when the prescription was written."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.Author.time"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-32-Original Order Date/Time / ORC-9-Date/Time of Transaction"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dateWritten.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.status"/>
      <definition>
        <short value="active | on hold | completed | entered in error | stopped | superceded"/>
        <formal value="A code specifying the state of the order.  Generally this will be active or completed state."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="true"/>
        <binding>
          <name value="MedicationPrescriptionStatus"/>
          <isExtensible value="false"/>
          <conformance value="required"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/vs/medication-prescription-status"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.statusCode"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.status.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.patient"/>
      <definition>
        <short value="Patient"/>
        <formal value="A link to a resource representing the person to whom the medication will be given."/>
        <comments value="SubstanceAdministration->subject->Patient."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="v2"/>
          <map value="PID-3-Patient ID List"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.patient.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.prescriber"/>
      <definition>
        <short value="Prescriber"/>
        <formal value="The healthcare professional responsible for authorising the prescription."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-13-Ordering Provider's DEA Number / RXO-14-Ordering Provider's DEA Number / RXE-14-Pharmacist/Treatment Supplier's Verifier ID / RXO-15-Pharmacist/Treatment Supplier's Verifier ID / ORC-12-Ordering Provider / PRT-5-Participation Person: PRT-4-Participation='OP' (all but last deprecated)"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.prescriber.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.encounter"/>
      <definition>
        <short value="Encounter / Admission / Stay"/>
        <formal value="A link to a resource that identifies the particular occurrence of contact between patient and health care provider."/>
        <comments value="SubstanceAdministration->component->EncounterEvent."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="v2"/>
          <map value="PV1-19-Visit Number"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.encounter.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.reasonForPrescribing"/>
      <definition>
        <short value="Reason or indication for writing the prescription"/>
        <formal value="Can be the reason or the indication for writing the prescription."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.RSON.A_SupportingClinicalInformation"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="ORC-16-Order Control Code Reason"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.reasonForPrescribing.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.medication"/>
      <definition>
        <short value="Medication to be taken"/>
        <formal value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."/>
        <comments value="Note: do not use Medication.name to describe the prescribed medication. When the only available information is a text description of the medication, Medication.code.text should be used."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.consumable"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-2-Give Code / RXO-1-Requested Give Code / RXD-2-Dispense/Give Code"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.medication.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction"/>
      <definition>
        <short value="Dosage instructions"/>
        <formal value="Indicates how the medication is to be used by the patient."/>
        <min value="0"/>
        <max value="*"/>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.modifierExtension"/>
      <definition>
        <short value="Extensions that cannot be ignored"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.dosageInstructionsText"/>
      <definition>
        <short value="Dosage text"/>
        <formal value="Free text dosage instructions for cases where the instructions are too complex to code."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-7.2-Provider's Administration Instructions.text / RXO-7.2-Provider's Administration Instructions.text / TQ1-10-Condition Text / TQ1-11-Text Instruction"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.dosageInstructionsText.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.additionalInstructions"/>
      <definition>
        <short value="Additional dosage instructions"/>
        <formal value="Additional instructions such as "Swallow with plenty of water" which may or may not be coded."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-7.2-Provider's Administration Instructions.text / RXO-7.2-Provider's Administration Instructions.text / TQ1-10-Condition Text / TQ1-11-Text Instruction ?"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.additionalInstructions.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.timing[x]"/>
      <definition>
        <short value="Medication timing"/>
        <formal value="The timing schedule for giving the medication to the patient.  The Schedule data type allows many different expressions, for example.  "Every  8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:";  "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013"."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <type>

        </type>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.effectiveTime"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RDS:TQ1"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.timing[x].extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.site"/>
      <definition>
        <short value="Entry site"/>
        <formal value="A coded specification of the anatomic site where the medication first enters the body."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <binding>
          <name value="MedicationAdministrationSite"/>
          <isExtensible value="true"/>
          <conformance value="example"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/vs/approach-site-codes"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.approachSiteCode"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXR-2-Administration Site"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.site.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.route"/>
      <definition>
        <short value="Route of administration"/>
        <formal value="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <binding>
          <name value="RouteOfAdministration"/>
          <isExtensible value="true"/>
          <conformance value="example"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/vs/route-codes"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.routeCode"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXR-1-Route"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.route.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.method"/>
      <definition>
        <short value="Administration method"/>
        <formal value="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  Examples:  Slow Push; Deep IV.

Terminologies used often pre-coordinate this term with the route and or form of administration."/>
        <comments value="SubstanceAdministration.methodCode."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <binding>
          <name value="MedicationAdministrationMethod"/>
          <isExtensible value="true"/>
          <conformance value="example"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/vs/administration-method-codes"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="v2"/>
          <map value="RXR-4-Administration Method"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.method.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.doseQuantity"/>
      <definition>
        <short value="Dose quantity per dose"/>
        <formal value="The amount of the therapeutic or other substance given at one administration event."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.doseQuantity"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-23-Give Rate Amount / RXE-24.1-Give Rate Units.code / RXE-24.3-Give Rate Units.name of coding system"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.doseQuantity.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.rate"/>
      <definition>
        <short value="Dose quantity per unit of time"/>
        <formal value="Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.rateQuantity"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-22-Give Per (Time Unit)"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.rate.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.maxDosePerPeriod"/>
      <definition>
        <short value="Total dose that should be consumed per unit of time"/>
        <formal value="The maximum total quantity of a therapeutic substance that my be administered to a subject over the period of time. E.g. 1000mg in 24 hours."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.maxDoseQuantity"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-4-Give Amount - Maximum / RXE-5-Give Units"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dosageInstruction.maxDosePerPeriod.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense"/>
      <definition>
        <short value="Dispense request"/>
        <formal value="Deals with details of the dispense part of the order."/>
        <min value="0"/>
        <max value="1"/>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.modifierExtension"/>
      <definition>
        <short value="Extensions that cannot be ignored"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.medication"/>
      <definition>
        <short value="Medication to be dispensed"/>
        <formal value="Identifies the medication that is to be dispensed.  This may be a more specifically defined than the medicationPrescription.medication . This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component1.administration.consumable"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-2-Give Code / RXO-1-Requested Give Code / RXD-2-Dispense/Give Code"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.medication.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.validityPeriod"/>
      <definition>
        <short value="Validity period"/>
        <formal value="Design Comments: This indicates the validity period of a prescription (stale dating the Prescription)
It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations.
Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component2.dispense.effectiveTime"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXD-3-Date/Time Dispensed ? / RXD-19-Substance Expiration Date"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.validityPeriod.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.numberOfRepeatsAllowed"/>
      <definition>
        <short value="Number of repeats allowed"/>
        <formal value="An integer indicating the number of repeats of the Dispense.
UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component2.dispense.repeatNumber"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXE-12-Number of Refills"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.numberOfRepeatsAllowed.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.quantity"/>
      <definition>
        <short value="Quanity"/>
        <formal value="The amount that is to be dispensed."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component2.dispense.quantity"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXD-4-Actual Dispense Amount / RXD-5.1-Actual Dispense Units.code / RXD-5.3-Actual Dispense Units.name of coding system"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.quantity.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.expectedSupplyDuration"/>
      <definition>
        <short value="Expected supply duration"/>
        <formal value="Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.
In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued. E.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.component2.dispense.expectedUseTime"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.dispense.expectedSupplyDuration.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution"/>
      <definition>
        <short value="Deals with substitution of one medicine for another"/>
        <formal value="Indicates whether or not substitution can or should as part of the dispense.  In some cases substitution must  happen, in other cases substitution must not happen, and in others it does not matter.  This block explains the prescribers intent.  If nothing is specified substitution may be done."/>
        <min value="0"/>
        <max value="1"/>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution.modifierExtension"/>
      <definition>
        <short value="Extensions that cannot be ignored"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution.type"/>
      <definition>
        <short value="Type of substitiution"/>
        <formal value="A code signifying whether a different drug should be dispensed from what was prescribed."/>
        <min value="1"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <binding>
          <name value="MedicationIntendedSubstitutionType"/>
          <isExtensible value="true"/>
          <conformance value="example"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/v3/vs/ActSubstanceAdminSubstitutionCode"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.subjectOf.SubstitutionPermission.code"/>
        </mapping>
        <mapping>
          <identity value="v2"/>
          <map value="RXO-9-Allow Substitutions / RXE-9-Substitution Status?"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution.type.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution.reason"/>
      <definition>
        <short value="Why should substitution (not) be made"/>
        <formal value="Indicates the reason for the substitution why substitution must or must not be performed."/>
        <min value="0"/>
        <max value="1"/>
        <type>

        </type>
        <isModifier value="false"/>
        <binding>
          <name value="MedicationIntendedSubstitutionReason"/>
          <isExtensible value="true"/>
          <conformance value="example"/>
          <referenceResource>
            <reference value="http://hl7.org/fhir/v3/vs/SubstanceAdminSubstitutionReason"/>
          </referenceResource>
        </binding>
        <mapping>
          <identity value="rim"/>
          <map value="CombinedMedicationRequest.subjectOf.SubstitutionPermission.reasonCode"/>
        </mapping>
      </definition>
    </element>
    <element>
      <path value="MedicationPrescription.substitution.reason.extension"/>
      <definition>
        <short value="Additional Content defined by implementations"/>
        <formal value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension."/>
        <comments value="there can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core simplicity for everyone."/>
        <synonym value="extensions"/>
        <synonym value="user content"/>
        <min value="0"/>
        <max value="*"/>
        <type>

        </type>
        <isModifier value="false"/>
      </definition>
    </element>
  </structure>
</Profile>