MedicationRequest (Clinician) Profile Example

<MedicationRequest xmlns="http://hl7.org/fhir">
    <id value="medicationrequest-clin-example" />
    <contained>
        <DetectedIssue>
            <!-- The Identifier was the ID of the detectedIssue monograph in instatiation/detectedIssueDefinition in the CeRX message, there may be some issues with duplicate identifiers if the ID is not unique across all IDs stored in the local DIS -->
            <id value="#detectedIssue2354" />
            <!-- carrying over "active" or "completed" will cause an issue in FHIR connformance, assumed that the value of "unknown" could be populated by the converter in these types of cases -->
            <status value="unknown" />
            <detail value="The patient has an intolerance to iron oxide found in Almotriptan malate 6.25mg" />
            <mitigation>
                <action>
                    <coding>
                        <!-- Implementation consideration: we know PEI uses v3-ActCode for this value but it's not communicated in any of the structured data of the test message -->
                        <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
                        <code value="5" />
                        <!-- In order to be meaningful to patients, the converter will likely need to create a display based on the value provided (5= consulted provider) -->
                    </coding>
                </action>
                <date value="2003-12-01T10:01:01-03:00" />
                <author>
                    <reference value="Practitioner/555555" />
                    <display value="Tech Timmy" />
                </author>
            </mitigation>
        </DetectedIssue>
    </contained>
    <identifier>
        <value value="222222" />
    </identifier>
    <status value="active" />
    <!-- Because the FHIR profile only provides an example binding, the original code in the CeRX message can be converted losslessly into the FHIR Resource.
      Keep in mind that this is not a perfect semantic match, it only applies to cases where status is affected by a refusal to fill or a  that were caused by errors in the original query (when use of PORX_IN060260CA/QUQI_MT120000CAcontrolActEvent/subjectOf/PORX_MT980020CA/detectedIssueEvent/code is appropriate) -->
    <statusReason>
        <coding>
            <code value="INT" />
        </coding>
    </statusReason>
    <intent value="order" />
    <reportedBoolean value="true" />
    <medicationCodeableConcept>
        <coding>
            <system value="http://hl7.org/fhir/NamingSystem/ca-hc-din" />
            <code value="00123556" />
            <display value="ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)" />
        </coding>
    </medicationCodeableConcept>
    <subject>
        <reference value="Patient/999999999" />
    </subject>
    <authoredOn value="2004-01-01T10:20:01-03:00" />
    <requester>
        <reference value="Practitioner/123456" />
    </requester>
    <performer>
        <reference value="Practitioner/888888" />
    </performer>
    <performerType>
        <coding>
            <code value="PSY" />
        </coding>
    </performerType>
    <reasonCode>
        <coding>
            <system value="http://snomed.info/sct" />
            <code value="37796009" />
            <display value="Migraine (disorder)" />
        </coding>
    </reasonCode>
    <reasonCode>
        <coding>
            <system value="http://hl7.org/fhir/sid/icd-10" />
            <code value="R51" />
            <display value="Headache" />
        </coding>
    </reasonCode>
    <reasonCode>
        <text value="An example textual description of an indication not meant to be either diagnosis or symptom" />
    </reasonCode>
    <courseOfTherapyType>
        <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v3-ActCode" />
            <code value="PRN" />
            <display value="as needed" />
        </coding>
    </courseOfTherapyType>
    <note>
        <authorReference>
            <reference value="Practitioner/777777" />
        </authorReference>
        <time value="2004-01-01T09:01:01-03:00" />
        <text value="Some textual observation about the dispense by the dispenser" />
    </note>
    <dosageInstruction>
        <sequence value="1" />
        <text value="Take 12.5 mg PO at onset; may repeat once after 2 hours. Not to exceed 25 mg/day. This medication is intended to address Migraines at onset. If you experience Migraines for more than 10 days/month, consult your doctor." />
        <timing>
            <repeat>
                <boundsPeriod>
                    <start value="2004-01-01" />
                    <end value="2004-01-31" />
                </boundsPeriod>
            </repeat>
        </timing>
        <!-- This "LA" (left arm) value is not clinically consistent with the rest of the example, it was kept to show how conversion might occur in cases where the medication was administered to a human body site -->
        <site>
            <coding>
                <system value="http://terminology.hl7.org/CodeSystem/v3-ActSite" />
                <code value="LA" />
                <display value="left arm" />
            </coding>
        </site>
        <route>
            <coding>
                <!-- The PEI DIS uses GCRT - Route of Administration Codes from 2.16.840.1.113883.4.80 instead of HL7 RouteOfAdministration vocab, no url for a system could be identified for GCRT -->
                <code value="3" />
            </coding>
        </route>
        <doseAndRate>
            <doseRange>
                <low>
                    <value value="6.25" />
                    <unit value="mg" />
                </low>
                <high>
                    <value value="6.25" />
                    <unit value="mg" />
                </high>
            </doseRange>
        </doseAndRate>
        <maxDosePerPeriod>
            <numerator>
                <value value="25" />
                <unit value="mg" />
            </numerator>
            <denominator>
                <value value="1" />
                <unit value="day" />
            </denominator>
        </maxDosePerPeriod>
    </dosageInstruction>
    <dispenseRequest>
        <initialFill>
            <quantity>
                <value value="100" />
                <unit value="mg" />
            </quantity>
            <duration>
                <value value="30" />
                <unit value="d" />
            </duration>
        </initialFill>
        <dispenseInterval>
            <value value="30" />
            <unit value="d" />
        </dispenseInterval>
        <validityPeriod>
            <start value="2004-01-01" />
            <end value="2006-01-02" />
        </validityPeriod>
        <numberOfRepeatsAllowed value="12" />
        <quantity>
            <value value="250" />
            <unit value="mg" />
        </quantity>
        <expectedSupplyDuration>
            <value value="30" />
            <unit value="Day" />
            <system value="http://unitsofmeasure.org" />
            <code value="d" />
        </expectedSupplyDuration>
        <performer>
            <reference value="Organization/123445" />
        </performer>
    </dispenseRequest>
    <substitution>
        <allowedBoolean value="true" />
        <reason>
            <coding>
                <!-- the comments in the test message indicate values from SubstanceAdminSubstitutionNotAllowedReason vocab are used, however no identifiers were provided outside of comments that could be transformed- so system was left out -->
                <code value="ALGAlT" />
            </coding>
        </reason>
    </substitution>
    <priorPrescription>
        <reference value="MedicationRequest/11111" />
    </priorPrescription>
</MedicationRequest>

Original CeRX Message

<PORX_IN060260CA xmlns="urn:hl7-org:v3" xmlns:gsd="http://aurora.regenstrief.org/GenericXMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:xlink="http://www.w3.org/TR/WD-xlink" xmlns:ex="urn:hl7-org/v3-example" xmlns:mif="urn:hl7-org:v3/mif" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 ../../schemas/mergedschemas/PORX_IN060260CA.xsd" ITSVersion="XML_1.0">
	<!-- A unique identifier for the message -->
	<id root="2.16.124.9.101.1.1.1" extension="122"/>
	<creationTime value="20040201102001"/>
	<versionCode code="V3-2005-05"/>
	<interactionId root="2.16.840.1.113883.1.6" extension="PORX_IN060260CA"/>
	<processingCode code="P"/>
	<processingModeCode code="T"/>
	<acceptAckCode code="ER"/>
	<receiver>
		<telecom use="WP" value="uri:198.203.1.21"/>
		<device>
			<id root="2.16.124.9.101.1.8"/>
		</device>
	</receiver>
		<sender>
		<telecom use="H" value="uri:198.203.1.23"/>
		<device>
			<id root="2.16.124.9.101.1.1"/>
			<name>PEI DIS</name>
		</device>
	</sender>
	<acknowledgement>
		<typeCode code="AA"/>
		<targetMessage>
			<id root="2.16.124.9.101.1.8.1" extension="122"/>
		</targetMessage>
	</acknowledgement>
	<controlActEvent>
		<id root="2.16.124.9.101.1.1.17" extension="1244"/>
		<code code="PORX_TE060220UV"/>
		<statusCode nullFlavor="NA"/>
		<subject contextConductionInd="false">
			<combinedMedicationRequest>
				<!-- The Prescription Order Number is a globally unique number assigned to a prescription by the EHR/DIS irrespective of the source of the order. It is created by the EHR/DIS once the prescription has passed all edits and validation -->
				<id root="2.16.124.9.101.1.1.4" extension="222222"/>
				<code code="DRUG"/>
				<!-- This denotes the state of the prescription in the lifecycle of the prescription. Valid statuses are: NEW, active, suspended, ABORTED, completed, SUPERCEDED and NULLIFIED. -->
				<statusCode code="active"/>
		<directTarget>
					<medication>
						<player>
							<code code="00123556" codeSystem="2.16.840.1.113883.5.1105"/>
							<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)</name>
							<!-- A free form textual description of a drug. This usually is only populated for custom compounds, providing instructions on the composition and creation of the compound. -->
							<desc>A concoction of this and that</desc>
							<!-- Implementation Variance PEI: For formCode in medication3- Use GCDF - Dosage Form Code - 2.16.840.1.113883.4.79 instead of HL7 OrderableDrugForm vocab -->
							<formCode code="SZ" codeSystem="2.16.840.1.113883.4.79"/>
							<asManufacturedProduct>
									<manufacturer>
										<name>Johnson Drugs Inc.</name>
									</manufacturer>
							</asManufacturedProduct>
							<!-- Information about how the dispensed drug is or should be contained, we included the COMPPKG form code to show what it might look like even though it's not clinically consistent with the medication above-->
							<asContent>
									<quantity value="250" unit="mg"/>
									<containerPackagedMedicine>
										<!-- A coded value denoting a specific kind of a container. Used to identify a requirement for a particular type of compliance packaging: CompliancePackageEntityType vocab -->
										<formCode code="COMPPKG"/>
									</containerPackagedMedicine>
							</asContent>
							<!-- can be up to 10 ingredients here - presumably, this would be for compounds -->
							<ingredient negationInd="false">
								<quantity value="90" unit="%"/>
								<ingredient>
									<!-- The unique identifier for the drug or chemical.  ActiveIngredientDrugEntityType- OID pulled from Infoway Value Set -->
									<code code="134529000" codeSystem="2.16.840.1.113883.2.20.3.251"/>
									<name>Name of the Ingredient</name>
								</ingredient>
							</ingredient>
						</player>
					</medication>
				</directTarget>
				<subject>
					<patient>
						<!-- phn identifier -->
						<id root="2.16.840.1.113883.4.13" extension="999999999"/>
						<telecom use="H" value="tel:9024567823"/>
						<patientPerson>
							<name use="L">
								<given>Patti</given>
								<family>Patient</family>
							</name>
							<administrativeGenderCode code="F"/>
							<birthTime value="19670405"/>
						</patientPerson>
					</patient>
				</subject>
				<!-- the provider who authorized the medication to be dispensed to the patient -->
				<author>
					<time value="20040101102001"/>
					<assignedPerson>
						<!-- prescriber id  -->
						<id root="2.16.840.1.113883.4.14" extension="123456"/>
						<!--  HealthcareProviderRoleType -->
						<code code="DR"/>
						<representedPerson>
							<name use="L">
								<given>Drake</given>
								<family>Ramoray</family>
							</name>
						</representedPerson>
					</assignedPerson>
				</author>
		<!-- Indicates the clinic or facility which originally issued the prescription. Identifies where paper records are likely located for follow-up.  This is marked as 'populated' because it won't always be known for 'inferred prescriptions -->
				<location>
					<serviceDeliveryLocation>
						<!-- a Prince Edward Island, Canada Department of Health Health Care Facility Identifier  -->
						<id root="2.16.840.1.113883.4.18" extension="32323232"/>
						<addr>
							<city>Charlottetown</city>
							<state>PE</state>
							<postalCode>C1A5M7</postalCode>
							<country>Canada</country>
						</addr>
						<telecom use="H" value="tel:9025555555"/>
						<location>
							<name>Polyclinic</name>
						</location>
					</serviceDeliveryLocation>
				</location>
				<!-- 0..5 elements for documentation of why a prescriber has chosen to prescribe the drug in the manner they have. Allows linking to specific guidelines or protocols.  Also used to provide additional detail needed when requesting a ‘special access’ drug from Health Canada.-->
		<definition>
					<substanceAdministrationDefinition>
						<!-- A unique identifier for a specific protocol  or guideline which the prescription has been written in accordance with. Enables the communication of a reference to a protocol, study or guideline id, specific to the jurisdiction; Allows providers to reference a protocol/guideline for prescribing to specific situations.  This could also be used for justification for prescribing a medication from a particular formulary.  E.g., 'Limited' Use’ medications in Ontario require physicians to use a code indicating that a patient is eligible for this particular medication.-->
						<id></id>
						<code code="DRUG"/> <!-- fixed value of DRUG -->
					</substanceAdministrationDefinition>
				</definition>
				<!-- optional element which gives a reference to a previous prescription which the current prescription replaces.-->
				<predecessor>
					<priorCombinedMedicationRequest>
						<!-- if of a previous prescription which the current prescription replaces -->
						<id root="2.16.124.9.101.1.1.4" extension="11111"/>
						<code code="DRUG"/> <!-- fixed value -->
					</priorCombinedMedicationRequest>
				</predecessor>
				<!-- 1..5 elements that give either a diagnosis, symptom or other prescribing indication that indicates why this particular rx was created -->
				<reason>
				<priorityNumber value="1"/>
					<observationDiagnosis>
						<!-- For SNOMED, the complete diagnosis appears here.  For non-SNOMED this should be a fixed value of "DX" -->
						<code code="37796009" codeSystem="2.16.840.1.113883.6.96"/>
						<text>Migraine (disorder)</text>
						<statusCode code="completed"/>
					</observationDiagnosis>
				</reason>
				<reason>
				<priorityNumber value="2"/>
					<!-- Describes symptom-related indications -->
					<observationSymptom>
						<!-- For SNOMED, this will communicate the full symptom.  For non-SNOMED this will be a fixed value of SYMPT -->
						<code code="SYMPT"/>
						<text>Headache symptom</text>
						<statusCode code="completed"></statusCode>
						<!-- A coded representation of the symptom that is the reason for the current therapy. This attribute is optional because it is not used by SNOMED  -->
						<value code="R51" codeSystem="2.16.840.1.113883.2.20.3.41"/>
					</observationSymptom>
				</reason>
				<reason>
					<priorityNumber value="3"/>
					<!-- Describes indications that are not diagnosis or symptom-related (e.g. contrast agents) -->
					<otherIndication>
						<!-- an optional code  indicating some other action which is the reason for a therapy. Allows for coded representation of a non-condition based indicaiton such as administration of a contrast agent for a lab test ActNonConditionIndicationCode vocab  -->
			<code code=""/>
						<text>An example textual description of an indication not meant to be either diagnosis or symptom</text>
						<statusCode code="completed"/>
					</otherIndication>
				</reason>
				<!-- If true (present), indicates that the prescription is non-authoritative.  I.e. A paper copy must be viewed before the prescription can be dispensed. Always the case (for now) for PEI -->
				<precondition>
					<verificationEventCriterion>
						<code code="VFPAPER"/>
					</verificationEventCriterion>
				</precondition>
				<!-- 0..6 elements which comprise the height and/or weight of a patient as measured/observed/known by the prescriber at the time of prescribing -->
				<pertinentInformation>
					<quantityObservationEvent>
						<!-- Identification of the type of observation that was made about the patient. The only two allowable types are height and weight. x_ActObservationHeightOrWeight vocab -->
						<code code="3137-7"/>
						<statusCode code="completed"/>
						<effectiveTime value="20040101"/>
						<!-- The amount (quantity and unit) that has been recorded for the patient's height and/or weight. E.g. height in meters, weight in kilograms, etc -->
						<value value="68" unit="kg"/>
					</quantityObservationEvent>
				</pertinentInformation>
				<!-- If present, indicates that the data associated with the prescription is uncertain because the existence of the prescription has been inferred from a secondary source (e.g. dispensing data)   -->
				<derivedFrom>
					<sourceDispense>
						<statusCode code="completed"/>
					</sourceDispense>
				</derivedFrom>
				<!--   0..5 elements to give an authorization issued by a payor to cover a drug not previously covered by a patient's drug plan.    -->
				<coverage>
					<coverage moodCode="">
						<!-- Unique identification for a specific coverage extension Allows for referencing of a specific coverage extension. This identifier may be needed on claims against the coverage. At times the ID will not be available (such as when the request has just been submitted), the attribute is 'populated' -->
						<id></id>
						<author>
							<underwriter>
								<!-- A unique identifier for the payor organization responsible for the coverage extension -->
								<id></id>
								<underwritingOrganization>
									<!-- name of payor -->
									<name></name>
								</underwritingOrganization>
							</underwriter>
						</author>
					</coverage>
				</coverage>
				<!-- 0..10 elements for the  Prescriber's instruction(s) for the administration of the medication. This information is needed for a prescription to be valid and is therefore mandatory. Multiple repetitions are supported for circumstances where a single therapy involves the administration of multiple drugs. E.g. Didrocal  -->
				<component1>
					<dosageInstruction moodCode="RQO">
						<!-- Distinguishes types of dosage : For SNOMED this will pre-coordinate route, body site and potentially drug.  For non-SNOMED, this will be a fixed value of DRUG. -->
						<code code="DRUG"/>
						<!-- required value free form textual specification made up of either an 'Ad-hoc dosage instruction' or 'Textual rendition of the structured dosage lines', plus route,dosage unit, and other pertinent administration information specified by the provider -->
						<text>Take 12.5 mg PO at onset; may repeat once after 2 hours. Not to exceed 25 mg/day. This medication is intended to address Migraines at onset. If you experience Migraines for more than 10 days/month, consult your doctor.</text>
						<!-- Administration Period : The time period (begin and end dates) within which the dispensed medication is to be completely administered to/by the patient. May differ from date prescription was issued. Frequently only the duration (width) component is specified. E.g. 100mg tid for 10 days.  In that case, the start date is presumed to be the date the prescription was written.-->
			<effectiveTime>
							<low value="20040101"/>
							<high value="20040131"/>
			</effectiveTime>
			<!-- This is the means by which the dispensed drug is to be administered to the patient : use GCRT - Route of Administration Code - 2.16.840.1.113883.4.80 instead of HL7 RouteOfAdministration vocab -->
				<routeCode code="3" codeSystem="2.16.840.1.113883.4.80"/>
			<!-- 0..5 of these HumanSubstanceAdministrationSite code - site on human body where drug should be administered, LA (left arm) was added to show the format even though it's not clinically consistent with the medication information above-->
						<approachSiteCode code="LA"/>
						<!-- The maximum amount of the dispensed medication to be administered to the patient in a 24-hr period (doses per day) or in a 7 day period (doses per week) -->
						<maxDoseQuantity>
							<numerator value="25" unit="mg"/>
							<denominator value="1" unit="day"/>
						</maxDoseQuantity>
						<!-- Identifies how the drug is measured for administration.  Specified when not implicit from the drug form  (e.g. puff, inhalation, drops, etc.). AdministrableDrugForm vocab -->
						<administrationUnitCode code="PUFF"/>
						<!-- Identification of drug product that the instruction pertains to. The drug only needs to be specified if the administration instruction corresponds to one part of the overall product. For example, referring to the administration of a particular product from a combo-pack -->
						<consumable>
							<medication1>
								<player>
									<code code="02466821" codeSystem="2.16.840.1.113883.5.1105"/>
									<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)</name>
									<!-- A free form textual description of a drug. This usually is only populated for custom compounds, providing instructions on the composition and creation of the compound but was included in this example message to provide additional detail. -->
									<desc>A concoction of this and that</desc>
									<!-- Implementation Variance PEI: For formCode in medication1- Use GCDF - Dosage Form Code - 2.16.840.1.113883.4.79 instead of HL7 OrderableDrugForm vocab -->
								<formCode code="SZ" codeSystem="2.16.840.1.113883.4.79"/>
									<asContent>
										<quantity value="250" unit="mg"/>
											<containerPackagedMedicine>
												<!-- A coded value denoting a specific kind of a container. Used to identify a requirement for a particular type of compliance packaging: CompliancePackageEntityType vocab -->
												<formCode code="COMPPKG"/>
											</containerPackagedMedicine>
									</asContent>
									<!-- can be up to 10 ingredients here - presumably, this would be for compounds -->
									<ingredient negationInd="false">
										<quantity value="90" unit="%"/>
										<ingredient>
											<!-- The unique identifier for the drug or chemical.  ActiveIngredientDrugEntityType -->
											<code code="134529000" codeSystem="2.16.840.1.113883.2.20.3.251"/>
											<name>Name of the Ingredient</name>
										</ingredient>
									</ingredient>
								</player>
							</medication1>
						</consumable>
						<!-- An optional  free form textual description of extended instruction regarding the administration of the drug. Allows for expression of non-codable qualifiers such as: 'on an empty stomach', 'add water' etc; which do not affect calculations of frequencies or quantity.-->
						<component1>
							<supplementalInstruction moodCode="RQO">
								<text>Can be taken on an empty stomach</text>
							</supplementalInstruction>
						</component1>
						<!-- 0..20 elements for dosage lines. This information, along with the order/sequence of the dosage lines,  constitutes the details of a structured dosage instruction. Enables SIG instructions to be discretely specified - PEI will store the entire structure verabatim.-->
						<component2>
							<sequenceNumber value="1"/>
							<dosageLine moodCode="RQO">
								<!--doseQuantity was not originally in the test message, because the field was noted as optional, it was constructed using the recommendation in the CeRX standard "Where no range is needed, sending the same value in both the low and the high is the preferred solution."-->
								<doseQuantity>
									<low unit="mg" value="6.25"/>
									<high unit="mg" value="6.25"/>
								</doseQuantity>
								<effectiveTime>
									<low value="20040101"/>
									<high nullFlavor="NA"/>
								</effectiveTime>
								<!--For intravenous and other such routes, this is the time period over which one dose is to be administered. The flow rate is determined by dividing the dose quantity by the Dosage rate. -->
								<rateQuantity></rateQuantity>
								<text>A free form description of how the dispensed medication is to be administered to the patient</text>
							</dosageLine>
						</component2>
					</dosageInstruction>
				</component1>
				<!-- Identification of prescriptions for which dispensers are encouraged to dispense partial quantities on trial basis.Trial fills are usually done with drugs that are either being tried on the patient for the first time or that the patient has indicated minor discomfort with their use. In order for the patient not to be saddled with costly and excessive medication on-hand, the tral process allows patients to test the tolerance and efficacy of drugs before completing fills. trial is authorized ('True') if this class is present -->
				<component2  negationInd="false">
					<trialSupplyPermission>
						<code code="TF"/>
					</trialSupplyPermission>
				</component2>
				<!-- required element for specification of how the prescribed medication is to be dispensed to the patient. Dispensed instruction information includes the quantity to be dispensed, how often the quantity is to be dispensed, etc -->
				<component3>
					<supplyRequest>
						<!-- Prescription Dispensable Indicator: This generally mirrors the status for the prescription, but in some circumstances may be changed to 'aborted' while the prescription is still active. When this occurs, it means the prescription may no longer be dispensed, though it may still be administered. Allows a prescriber to say "Finish what you have on hand, but don't get any more." Because the status should always be known, this element is mandatory.-->
						<statusCode code="active"/>
						<!-- Optional: 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 Prescription Effective Period 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   -->
						<effectiveTime>
							<low value="20040101"/>
							<high value="20060102"/>
						</effectiveTime>
						<!--   0..5 elements to identify the person(s) other than the patient, who are authorized to pick up the medication. Used when patient is not in a position to pick up medication and when alternate receivers must be specifically authorized (e.g. for narcotics). Repetitions are specified to allow for any one of multiple agents of the patient (e.g. Mother, Father, Cousin, Friend, etc) to be designated as allowed to pick up dispensed drugs-->
			<receiver>
							<responsibleParty>
								<id root="2.16.124.9.101.1.4.1" extension="123"/>
								<!-- optional responsible Person Type.  x_SimplePersonalRelationship -->
								<code code="FAMMEMB"/>
								<agentPerson>
									<name>
										<given>Gerry</given>
										<family>Patient</family>
									</name>
								</agentPerson>
					</responsibleParty>
						</receiver>
						<!-- Indicates the pharmacy to which the prescription has been directed or which has currently assumed responsibility for dispensing the prescription. Allows prescriptions to be directed on the request of the patient or by legal requirement.  Also allows indication of which pharmacy is the current 'custodian' of the prescription. This should always be known or should have an explicit null flavor of 'NA' (non-assigned) or 'UNK' (paper prescription).  Thus the association is'populated'.   -->
						<location>
							<time value="20040101100000"/>
							<!-- optional indicator whether a dispenser to whom the prescription is targeted is a mandated or patient-preferred pharmacy. Influences whether the prescription may be transferred to a service delivery location other than the targeted dispenser x_SubstitutionConditionNoneOrUnconditional vocab NOSUB	No substitution UNCOND	Unconditional -->
							<substitutionConditionCode code="NOSUB"/>
							<serviceDeliveryLocation>
								<!-- a pharmacy id -->
								<id root="2.16.840.1.113883.4.19" extension="123445"/>
								<addr>
									<city>Charlottetown</city>
									<state>PE</state>
									<postalCode>C1A5M7</postalCode>
									<country>Canada</country>
								</addr>
								<telecom use="H" value="tel:9023457823"/>
								<location>
									<name>Shopper's Drug Mart</name>
								</location>
							</serviceDeliveryLocation>
						</location>
						<!-- 1..5 elements to identify the instructions for how the prescribed medication should be dispensed to the patient. An essential part of most prescriptions is the authorization to dispense. Multiple repetitions are included to accommodate circumstances where multiple drug products may need to be dispensed to complete a therapy. E.g. 100 x 20mg tablets and 50 x 10mg tablets. The association is marked as Populated because the authorization to dispense is a critical portion of a prescription. However the association is allowed to be 'null' when the order is for a medication which requires no dispense authorization (e.g. over-the-counter medications), or when the patient already has sufficient supply of the medication on hand to complete the therapy-->
						<component>
							<!-- Specification of the overall use duration of the prescrbed medication and/or overall quantity to be dispensed. -->
							<supplyRequestItem>
								<!-- Optional Total Prescribed Quantity: The overall amount of amount medication to be dispensed under this prescription. Includes any first fills (trials, aligning quantities) the initial standard fill plus all refills.  Sets upper limit for medication to be dispensed. Can be used to verify the intention of the prescriber with respect to the overall medication.  Used for comparison when determining whether additional quantity may be dispensed in the context of a part-fill prescription.-->
								<quantity unit="mg" value="250"/>
								<!-- The number of days that the overall prescribed item is expected to last, if the patient is compliant with the dispensing and administration of the prescription. Used to specify a total authorization as a duration rather than a quantity with refills. E.g. dispense 30 at a time, refill for 1 year. May also be sent as an estimate of the expected overall duration of the prescription based on the quantity prescribed. This attribute is mandatory because the prescriber (in discussion with the patient) has a better understanding of the days supply needed by the patient-->
								<expectedUseTime>
									<width value="10" unit="d"/>
								</expectedUseTime>
								<product>
									<medication>
										<player>
											<code code="02466821" codeSystem="2.16.840.1.113883.5.1105"/>
											<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)</name>
											<!-- A free form textual description of a drug. This usually is only populated for custom compounds, providing instructions on the composition and creation of the compound but was included in this example message to provide additional detail. -->
											<desc>A concoction of this and that</desc>
											<!-- Implementation Variance PEI: For formCode in medication3- Use GCDF - Dosage Form Code - 2.16.840.1.113883.4.79 instead of HL7 OrderableDrugForm vocab -->
									<formCode code="SZ" codeSystem="2.16.840.1.113883.4.79"/>
											<asContent>
													<quantity value="250" unit="mg"/>
												<containerPackagedMedicine>
													<!-- A coded value denoting a specific kind of a container. Used to identify a requirement for a particular type of compliance packaging: CompliancePackageEntityType vocab -->
													<formCode code="COMPPKG"/>
												</containerPackagedMedicine>
											</asContent>
											<!-- can be up to 10 ingredients here - presumably, this would be for compounds -->
										<ingredient negationInd="false">
											<quantity value="90" unit="%"/>
											<ingredient>
												<!-- The unique identifier for the drug or chemical.  ActiveIngredientDrugEntityType -->
												<code code="134529000" codeSystem="2.16.840.1.113883.2.20.3.251"/>
												<name>Name of the Ingredient</name>
											</ingredient>
										</ingredient>
										</player>
									</medication>
								</product>
								<!-- Indicates the number of refills permitted on the prescription  -->
								<component1>
									<sequenceNumber value="2"></sequenceNumber>
									<!-- Dispensing instruction for all dispenses subsequent to the first fill -->
									<subsequentSupplyRequest>
										<!--optionally Indicates a minimum amount of time that must occur between dispenses -->
										<effectiveTime>
											<width value="30" unit="d"/>
										</effectiveTime>
									<!-- optionally indicates the number of times the prescribed quantity is to be dispensed including the initial standard fill. Used to calculate total prescribed quantity; and also used for compliance checking. Expressed as Number of Fills rather than number of refills due to HL7 modeling constraints  -->
										<repeatNumber value="12"/>
										<!-- The amount of medication to be dispensed to the patient for each normal fill (excluding trial or other special first fills) -->
										<quantity value="250" unit="mg"/>
										<!-- The number of days that each standard fill is expected to last. The dispenser must use the administration instructions together with the Days Supply to calculate the total quantity to dispense per fill. May be specified in addition to quantity to indicate the length of time a quantity of 'as needed' medication is expected to last. -->
										<expectedUseTime>
											<width value="30" unit="d"/>
										</expectedUseTime>
									</subsequentSupplyRequest>
								</component1>
								<!-- optionally Indicates the date and quantity for the first dispense on the prescription, as well as count-down of refills dispensed. Used in case of trial prescription or in situations where the first fill may be different from subsequent fills for administrative or non-clinical reasons (e.g. to align the refill dates of a series of prescriptions)-->
								<component2>
									<sequenceNumber value="1"/>
									<!-- Special instructions regarding the very first supply of medication to a patient Allows a different amount to be dispensed on an initial fill, either as a trial or to synchronize refill dates across multiple patient prescriptions-->
									<initialSupplyRequest>
										<!-- The date before which an initial dispense can be made against the prescription.If an initial fill has not been made against the prescription in this time-period, it may not be dispensed -->
										<effectiveTime>
											<high value="20040101"/>
										</effectiveTime>
										<!-- optionally indicates the quantity of medication to be dispensed the first time  the prescription is dispensed against -->
										<quantity unit="mg" value="10"/>
										<!-- optionally indicates the number of days that the first fill is expected to last, if the patient is compliant with the dispensing of the first fill and with administration of the prescription -->
										<expectedUseTime>
											<width value="30" unit="d"/>
										</expectedUseTime>
									</initialSupplyRequest>
								</component2>
								<!-- optional element to provide summary information about the first dispense made on the prescription -->
								<fulfillment1>
									<subsetCode code="FIRST"/>
									<!-- Provides summary information about the first dispense event on the prescription -->
									<supplyEventFirstSummary>
										<!-- optionally indicates when the first dispense against the prescription was picked up -->
										<effectiveTime>
											<high value="20040101"/>
										</effectiveTime>
										<!-- Indicates the amount of medication first dispensed on the prescriptio -->
										<quantity value="10" unit="mg"/>
									</supplyEventFirstSummary>
								</fulfillment1>
								<!-- optional element to provide summary information about the most recent dispense on the prescription -->
								<fulfillment2>
									<subsetCode code="RECENT"/>
									<!-- Provides summary information about the most recent dispense event performed against the prescription -->
									<supplyEventLastSummary>
										<!-- Indicates the most recent date on which a dispense on the prescription was picked up -->
										<effectiveTime>
											<high value="20040101"/>
										</effectiveTime>
										<!-- Indicates the most recent quantity of the drug that was picked up for the prescription. Useful in determining amout of medication that a patient should have on-hand. Also provides an indication of compliance. Because the quantity should always be known if the last dispense is known, this attribute is mandatory  -->
										<quantity value="10" unit="mg"/>
									</supplyEventLastSummary>
								</fulfillment2>
								<!-- optional element that provides summary information about what dispenses remain to be performed against the prescription -->
								<fulfillment3>
									<subsetCode code="FUTSUM"/>
									<!-- At least one of quantity and repeatNumber must be specified -->
									<supplyEventFutureSummary>
										<!-- Indicates the number of remaining dispenses estimated, assuming that each fill is equal to the quantity prescribed for a single fill, rounding up. Indicates the number of dispenses that may still occur  -->
					<repeatNumber value="5"/>
					<!-- optional element that indicates the total remaining undispensed quantity authorized against the prescription -->
					<quantity value="100" unit="mg"/>
									</supplyEventFutureSummary>
								</fulfillment3>
								<!-- optional element summarizes the dispenses that have happened against the prescription to date  -->
								<fulfillment4>
									<subsetCode code="PREVSUM"></subsetCode>
									<!-- At least one of quantity and repeatNumber must be specified. -->
									<supplyEventPastSummary>
										<!-- Indicates the number of dispense events performed against the prescription to date, including trial, partial and complete fills. -->
										<repeatNumber value="10"/>
										<!-- Indicates the amount of the prescrion medication that has been dispensed to-date -->
										<quantity value="10" unit="mg"/>
									</supplyEventPastSummary>
								</fulfillment4>
							</supplyRequestItem>
						</component>
					</supplyRequest>
				</component3>
				<!-- 0..999 elements to show the dispenses that have occurred against this prescription. -->
				<fulfillment1>
					<medicationDispense>
						<id root="2.16.124.9.101.1.1.3" extension="987654321"/>
						<statusCode code="COMPLETE"/>
						<!-- optionally the represented person - the supervisor pharmacist -->
						<responsibleParty>
							<assignedPerson>
								<!-- pharmacist or prescriber id- in original test message the OID was set to Special Authorization Identifier (2.16.124.9.101.1.1.7) we believe this was an oversight -->
								<id root="2.16.840.1.113883.4.15" extension="777777"/>
								<representedPerson>
									<name use="L">
										<given>Sue</given>
										<family>Script</family>
									</name>
								</representedPerson>
							</assignedPerson>
						</responsibleParty>
						<!--  the pharmacist or pharm tech - in original test message the OID was set to Special Authorization Identifier (2.16.124.9.101.1.1.7) we believe this was an oversight-->
						<performer typeCode="PRF">
							<assignedPerson>
								<!-- pharmacist or prescriber id  -->
								<id root="2.16.840.1.113883.4.76" extension="888888"/>
								<representedPerson>
									<name use="L">
										<given>Robert</given>
										<family>Technician</family>
									</name>
								</representedPerson>
							</assignedPerson>
						</performer>
						<!-- Indicates the service delivery location where the drug was dispensed -->
						<location>
							<serviceDeliveryLocation>
								<!-- a pharmacy id - in original test message the OID was set to Adjudicated Invoice Group Identiifer (2.16.124.9.101.1.1.2) we believe this was an oversight -->
								<id root="2.16.840.1.113883.4.19" extension="123445"/>
								<addr>
									<city>Charlottetown</city>
									<state>PE</state>
									<postalCode>C1A5M7</postalCode>
									<country>Canada</country>
								</addr>
								<telecom use="H" value="tel:9023457823"/>
								<location>
									<name>Shopper's Drug Mart</name>
								</location>
							</serviceDeliveryLocation>
						</location>
						<!-- 1..10 elements for the dosage instructions (these are the admin instructions from old dispense message) -->
						<component1>
							<dosageInstruction moodCode="EVN">
								<!-- Distinguishes types of dosage : For SNOMED this will pre-coordinate route, body site and potentially drug.  For non-SNOMED, this will be a fixed value of DRUG. -->
								<code code="DRUG"/>
								<!-- required value free form textual specification made up of either an 'Ad-hoc dosage instruction' or 'Textual rendition of the structured dosage lines', plus route, dosage unit, and other pertinent administration information specified by the provider -->
								<text>Take 12.5 mg PO at onset; may repeat once after 2 hours. Not to exceed 25 mg/day. This medication is intended to address Migraines at onset. If you experience Migraines for more than 10 days/month, consult your doctor.</text>
					<effectiveTime>
									<low value="20040101"/>
									<high value="20040131"/>
					</effectiveTime>
					<!-- Implementation Variance PEI: This is the means by which the dispensed drug is to be administered to the patient :  use GCRT - Route of Administration Code - 2.16.840.1.113883.4.80 instead of HL7 RouteOfAdministration vocab -->
							<routeCode code="3" codeSystem="2.16.840.1.113883.4.80"/>
								<maxDoseQuantity>
									<numerator value="25" unit="mg"/>
									<denominator value="1" unit="day"/>
								</maxDoseQuantity>
								<!-- Identifies how the drug is measured for administration.  Specified when not implicit from the drug form  (e.g. puff, inhalation, drops, etc.). AdministrableDrugForm vocab -->
								<administrationUnitCode code="PUFF"/>
								<!-- Identification of drug product that the instruction pertains to. The drug only needs to be specified if the administration instruction corresponds to one part of the overall product. For example, referring to the administration of a particular product from a combo-pack -->
					<consumable>
									<medication3>
										<player>
											<code code="02466821" codeSystem="2.16.840.1.113883.5.1105"/>
											<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)</name>
											<!-- A free form textual description of a drug. This usually is only populated for custom compounds, providing instructions on the composition and creation of the compound but was included in this example message to provide additional detail. -->
											<desc>A concoction of this and that</desc>
											<!-- Implementation Variance PEI: For formCode in medication3- Use GCDF - Dosage Form Code - 2.16.840.1.113883.4.79 instead of HL7 OrderableDrugForm vocab -->
											<formCode code="SZ" codeSystem="2.16.840.1.113883.4.79"/>
											<lotNumberText>2145</lotNumberText>
											<expirationTime>
												<width unit="d" value="30"/>
											</expirationTime>
											<asContent>
												<quantity value="250" unit="mg"/>
													<containerPackagedMedicine>
														<!-- A coded value denoting a specific kind of a container. Used to identify a requirement for a particular type of compliance packaging: CompliancePackageEntityType vocab -->
														<formCode code="COMPPKG"/>
													</containerPackagedMedicine>
											</asContent>
											<!-- can be up to 10 ingredients here - presumably, this would be for compounds -->
											<ingredient negationInd="false">
												<quantity value="90" unit="%"/>
												<ingredient>
													<!-- The unique identifier for the drug or chemical.  ActiveIngredientDrugEntityType -->
													<code code="134529000" codeSystem="2.16.840.1.113883.2.20.3.251"/>
													<name>Name of the Ingredient</name>
												</ingredient>
											</ingredient>
										</player>
									</medication3>
								</consumable>
								<component1>
									<supplementalInstruction moodCode="EVN">
										<text>Can be taken on an empty stomach</text>
									</supplementalInstruction>
								</component1>
								<!-- 0..20 elements for dosage lines. This information, along with the order/sequence of the dosage lines,  constitutes the details of a structured dosage instruction. Enables SIG instructions to be discretely specified - PEI will store the entire structure verabatim.-->
								<component2>
									<sequenceNumber value="1"/>
									<dosageLine moodCode="EVN">
										<doseQuantity value="6.25" unit="mg"/>
										<text>A free form description of how the dispensed medication is to be administered to the patient</text>
										<!-- more elements - but PEI will not parse the individual elements, they'll store the entire xml structure -->
									</dosageLine>
								</component2>
							</dosageInstruction>
						</component1>
						<!-- optional element for substitution details -->
						<component2>
							<substitutionMade>
								<code code="N"/> <!-- eg n - no substitution was done -->
								<!-- required : fixed value of completed -->
								<statusCode code="completed"/>
								<!--optional value to indicate the reason for the substitution of (or lack of substitution) from what was prescribed : SubstanceAdminSubstitutionReason -->
								<reasonCode code="OS"/> <!-- OS - indicates out of stock -->
								<responsibleParty>
									<agent>
										<id root="2.16.840.1.113883.4.15" extension="2356"/>
									</agent>
								</responsibleParty>
							</substitutionMade>
						</component2>

						<!-- required element with dispensing info -->
						<component3>
							<supplyEvent>
								<!-- Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. ActPharmacySupplyType vocab -->
								<code code="FF"/>
								<effectiveTime>
										<low value="20040101"/>
										<high nullFlavor="NA"/>
								</effectiveTime>
								<quantity value="250" unit="mg"/>
								<!-- The number of days that the overall prescribed item is expected to last, if the patient is compliant with the dispensing and administration of the prescription. Used to specify a total authorization as a duration rather than a quantity with refills. E.g. dispense 30 at a time, refill for 1 year. May also be sent as an  estimate of the expected overall duration of the prescription based on the quantity prescribed. This attribute is mandatory because the prescriber (in discussion with the patient) has a better understanding of the days supply needed by the patient-->
								<expectedUseTime>
									<width unit="d" value="30"/>
								</expectedUseTime>
								<product>
									<medication>
										<player>
											<code code="02466821" codeSystem="2.16.840.1.113883.5.1105"/>
											<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 12.5 mg oral tablet)</name>
											<desc>A concoction of this and that</desc>
											<!-- Indicates the form in which the drug product must be, or has been manufactured or custom prepared. OrderableDrugForm vocab -->
											<formCode code="PILL"/>
											<lotNumberText>2145</lotNumberText>
											<expirationTime>
												<width unit="d" value="30"/>
											</expirationTime>
											<asContent>
													<quantity value="250.0" unit="mg"/>
													<containerPackagedMedicine>
														<!-- A coded value from CompliancePackageEntityType vocab -->
														<formCode code="COMPPKG"/>
													</containerPackagedMedicine>
											</asContent>
										</player>
									</medication>
								</product>
							</supplyEvent>
						</component3>
						<!-- 0..20 elements to show how the status of the dispense has changed over tim  i.e. one element for every controlActEvent of every message that updated this entity-->
						<subjectOf1>
							<controlActEvent>
							<!-- <id></id> -->
								<code></code>
								<statusCode></statusCode>
								<effectiveTime></effectiveTime>
								<reasonCode></reasonCode>
								<responsibleParty>
									<assignedPerson>
										<id></id>
										<representedPerson>
											<name></name>
										</representedPerson>
									</assignedPerson>
								</responsibleParty>
								<author>
									<time></time>
									<assignedPerson>
										<id></id>
										<representedPerson>
											<name></name>
										</representedPerson>
									</assignedPerson>
								</author>
							</controlActEvent>
						</subjectOf1>
						<!-- 0..99 optional element for a note attached to the dispense: notes now have language code, but have dropped code to indicate note type -->
						<subjectOf2>
							<annotation>
								<!-- Free text comments. Additional textual instructions entered about the dispense event. -->
								<text>Some textual observation about the dispense by the dispenser</text>
								<!-- required element with default value - status code is now everywhere -->
								<statusCode code="active"/>
								<languageCode code="EN"/>
								<author>
									<time value="20040101090101"/>
									<assignedPerson>
										<!-- id of provider who adds the note -->
										<id root="2.16.840.1.113883.4.15" extension="777777"/>
										<representedPerson>
											<name use="L">
												<given>Sue</given>
												<family>Script</family>
											</name>
										</representedPerson>
									</assignedPerson>
								</author>
							</annotation>
						</subjectOf2>
						<!-- if the return issues flag was off on the query - PEI will use this element to communicate whether there are any issues if present Indicates  there are issues-->
						<subjectOf3>
							<subsetCode code="SUM"></subsetCode>
							<detectedIssueIndicator>
								<statusCode code="completed"></statusCode>
							</detectedIssueIndicator>
						</subjectOf3>
						<!-- 0..50 elements to describe the issues attached to the dispense -->
						<subjectOf4>
							<detectedIssueEvent>
								<!-- ActDetectedIssueCode vocab: A coded value that is used to distinguish between different kinds of issues INT indicates intolerance alert-->
								<code code="INT"/>
								<text>The patient has an intolerance to iron oxide found in Almotriptan malate 6.25mgy</text>
								<statusCode code="active"/>
								<!-- A coded value denoting the importance of a detectable issue. Valid codes are: I - for Information, E - for Error, and W - for Warning -->
								<priorityCode code="W"/>
								<!-- 0..25 elements to indicate the event that trigger the issue -->
								<!-- active medication (prescription or non-prescription medication) that is recorded in the patient’s record and which contributed to triggering the issue -->
								<subject>
									<substanceAdministration moodCode="">
										<!-- Unique identifier of the prescription, immunization, or non-prescription drug record that triggered the issue - i.e. Interacting Prescription Number identifier-->
										<id root="2.16.124.9.101.1.1.4" extension="11111"/>
										<!-- Uses: ActSubstanceAdministrationCode: DRUG or IMMUNIZ-->
										<code code="DRUG"/>
										<statusCode code="active"/>
										<effectiveTime>
										<low value="20031101"/>
											<high value="20031130"/>
										</effectiveTime>
										<doseQuantity value="6.25" unit="mg"/>
										<consumable>
											<medication>
												<player determinerCode="KIND">
													<code code="02405792" codeSystem="2.16.840.1.113883.5.1105"/>
													<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 6.25 mg oral tablet)</name>
												</player>
											</medication>
										</consumable>
									</substanceAdministration>
								</subject>
								<subject>
									<supplyEvent>
										<!-- Unique identifier of the dispensed event that triggered the issue. -->
										<id root="2.16.124.9.101.1.1.3" extension="121111"/>
										<statusCode code="completed"/>
										<!-- The date and time on which the product was issued to the patient. IVL.HIGH<TS.FULLDATE>	End date (includes end-date but start date and duration are unspecified)  -->
										<effectiveTime>
											<high value="20031101"/>
										</effectiveTime>
										<product>
											<medication>
												<player determinerCode="KIND">
													<code code="02405792" codeSystem="2.16.840.1.113883.5.1105"/>
													<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 6.25 mg oral tablet)</name>
												</player>
											</medication>
										</product>
										<location>
											<serviceDeliveryLocation>
												<id root="2.16.840.1.113883.4.19" extension="123445"/>
												<addr>
													<city>Charlottetown</city>
													<state>PE</state>
													<postalCode>C1A5M7</postalCode>
													<country>Canada</country>
												</addr>
												<telecom use="WP" value="tel:9023457823"/>
												<location>
													<name>Shopper's Drug Mart</name>
												</location>
											</serviceDeliveryLocation>
										</location>
									</supplyEvent>
								</subject>
								<instantiation>
									<detectedIssueDefinition>
										<!--  issue id: Knowledgebase organization specific identifier for the issue definition: we return the id of the monograph here allowing them to provide this in a future query where PEI will return the monograph text -->
										<id root="2.16.124.9.101.1.1.16" extension="2354"/>
										<author>
											<assignedEntity>
												<assignedOrganization>
													<name>FDB</name>
												</assignedOrganization>
											</assignedEntity>
										</author>
									</detectedIssueDefinition>
								</instantiation>
								<mitigatedBy>
									<detectedIssueManagement>
										<!-- ActDetectedIssueManagementCode vocab,  Indicates the kinds of management actions that have been taken, depending on the issue type -->
										<code code="5"/> <!-- consulted prescriber -->
										<!-- Additional free-text details describing the management of the issue -->
										<text>The 6.25mg dose pill included iron oxide which the patient was allergic to. The provider was consulted and issued a new prescription for the 12.5mg dose pill that does not include iron oxide. Patient was informed that they can not exceed 25mg/day</text>
										<statusCode code="active"/>
										<author>
											<time value="20031201100101"/>
											<assignedPerson>
												<!-- provider who managed the issue -->
												<id root="2.16.840.1.113883.4.76" extension="555555"/>
												<!--  HealthcareProviderRoleType -->
												<code code="PSY"/> <!--don't believe PSY is correct code (removed it from the other providers) but leaving it in this one place for notation-->
												<representedPerson>
													<name use="L">
														<given>Tech</given>
														<family>Timmy</family>
													</name>
												</representedPerson>
											</assignedPerson>
										</author>
									</detectedIssueManagement>
								</mitigatedBy>
								<subjectOf>
									<severityObservation>
										<code code="SEV"/>
										<statusCode code="completed"/>
										<!-- SeverityObservation vocab,  A coded value denoting the gravity of the detected issue -->
										<value code="M"/> <!-- moderate -->
									</severityObservation>
								</subjectOf>
							</detectedIssueEvent>
						</subjectOf4>
						<!-- if the return notes flag was off on the query instead of returning the notes, PEI will simply use the presence or absence of this element to comunicate whether notes are attached or not -->
						<subjectOf5>
							<subsetCode code="SUM"></subsetCode>
							<annotationIndicator>
								<statusCode code="completed"></statusCode>
							</annotationIndicator>
						</subjectOf5>
					</medicationDispense>
				</fulfillment1>
				<!-- 0..25 elements for any issues attached to the prescription -->
				<subjectOf1>
					<detectedIssueEvent>
						<!-- ActDetectedIssueCode vocab: A coded value that is used to distinguish between different kinds of issues INT indicates intolerance alert-->
						<code code="INT"/>
						<!-- An optional free form textual description of a detected issue -->
						<text>The patient has an intolerance to iron oxide found in Almotriptan malate 6.25mg</text>
						<statusCode code="active"/>
						<!-- A coded value denoting the importance of a detectable issue. Valid codes are: I - for Information, E - for Error, and W - for Warning -->
						<priorityCode code="W"/>
						<!-- 0..25 elements to indicate the event that trigger the issue -->
						<!-- active medication (prescription or non-prescription medication) that is recorded in the patient’s record and which contributed to triggering the issue -->
						<subject>
							<substanceAdministration moodCode="">
								<!-- Unique identifier of the prescription, immunization, or non-prescription drug record that triggered the issue - i.e. Interacting Prescription Number identifier-->
								<id root="2.16.124.9.101.1.1.4" extension="11111"/>
								<!-- Identifies whether the interaction is with a drug or a vaccine : ActSubstanceAdministrationCode: DRUG or IMMUNIZ-->
								<code code="DRUG"/>
								<!-- ActStatus: Indicates the status of the medication record at the time of the issue-->
								<statusCode code="active"/>
								<effectiveTime>
									<low value="20031101"/>
									<high value="20031130"/>
								</effectiveTime>
								<doseQuantity value="6.25" unit="mg"/>
								<consumable>
									<medication>
										<player determinerCode="KIND">
											<code code="02405792" codeSystem="2.16.840.1.113883.5.1105"/>
											<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 6.25 mg oral tablet)</name>
										</player>
									</medication>
								</consumable>
							</substanceAdministration>
						</subject>
						<!-- Indicates a particular dispense event that resulted in the issue -->
						<subject>
							<supplyEvent>
								<!-- Unique identifier of the dispensed event that triggered the issue. -->
								<id root="2.16.124.9.101.1.1.3" extension="121111"/>
								<statusCode code="active"/>
								<effectiveTime>
									<high value="20031101"/>
								</effectiveTime>
								<product>
									<medication>
										<player determinerCode="KIND">
											<code code="02405792" codeSystem="2.16.840.1.113883.5.1105"/>
											<name>ALMOTRIPTAN (almotriptan (almotriptan malate) 6.25 mg oral tablet)</name>
										</player>
									</medication>
								</product>
								<location>
									<serviceDeliveryLocation>
										<id root="2.16.840.1.113883.4.19" extension="123445"/>
										<addr>
											<city>Charlottetown</city>
											<state>PE</state>
											<postalCode>C1A5M7</postalCode>
											<country>Canada</country>
										</addr>
										<telecom use="WP" value="tel:9023457823"/>
										<location>
											<name>Shopper's Drug Mart</name>
										</location>
									</serviceDeliveryLocation>
								</location>
							</supplyEvent>
						</subject>

						<!-- This is the recorded observation (e.g. allergy, medical condition, lab result, pregnancy status, etc.) of the patient that contributed to the issue being raised.  -->
						<subject>
							<observationCodedEvent>
								<!-- Unique identifier for the record of the coded observation (e.g. allergy, medical condition, pregnancy status, etc.) that contributed to the issue.  -->
								<id root="2.16.124.9.101.1.1.11" extension="1235616"/>
								<!-- Distinguishes the kinds of coded observation that could be the trigger for clinical issue detection. Coded Observation types include: Allergy, Intolerance, Medical Condition, Indication, Pregnancy status, Lactation status and other observable information about a person that may be deemed as a possible trigger for clinical issue detection. Use ObservationIssueTriggerCodedObservationType -->
								<code code="ALLERGY"/>
								<statusCode code="active"></statusCode>
								<!-- Denotes a specific coded observation made about a person that might have trigger the clinical issue detection -->
								<value code="PeanutButter"/>
							</observationCodedEvent>
						</subject>
						<!-- This is the recorded observation (e.g. height, weight, lab result, etc.) of the patient that contributed to the issue being raised.  -->
						<subject>
							<observationMeasurableEvent>
								<!-- Unique identifier for the record of the observation (e.g. height, weight or lab test/result) that contributed to the issue -->
								<id root="2.16.124.9.101.1.1.6" extension="156"/>
								<!-- ObservationIssueTriggerMeasuredObservationType: Distinguishes between the kinds of measurable observation that could be the trigger for clinical issue detection. Measurable observation types include: Lab Result, Height, Weight, and other measurable information about a person that may be deemed as a possible trigger for clinical issue detection.  -->
								<code code="3137-7"/> <!-- body height measured -->
								<statusCode code="active"></statusCode>
							</observationMeasurableEvent>
						</subject>
						<!-- optional element that is the decision support rule that triggered the issue: Provides detailed background for providers in evaluating the issue -->
						<instantiation>
							<detectedIssueDefinition>
								<!--  issue id: Knowledgebase organization specific identifier for the issue definition: PEI will return the id of the monograph here allowing them to provide this in a future query where PEI will return the monograph text -->
								<id root="2.16.124.9.101.1.1.16" extension="2354"/>
								<author>
									<assignedEntity>
										<assignedOrganization>
											<name>FDB</name>
										</assignedOrganization>
									</assignedEntity>
								</author>
							</detectedIssueDefinition>
						</instantiation>

						<!-- supplied management for the issue -->
						<mitigatedBy>
							<detectedIssueManagement>
								<!-- ActDetectedIssueManagementCode vocab,  Indicates the kinds of management actions that have been taken, depending on the issue type -->
								<code code="5"/> <!-- consulted prescriber -->
								<!-- Additional free-text details describing the management of the issue -->
								<text>The 6.25mg dose pill included iron oxide which the patient was allergic to. The provider was consulted and issued a new prescription for the 12.5mg dose pill that does not include iron oxide. Patient was informed that they can not exceed 25mg/day</text>
								<statusCode code="active"/>
								<author>
									<time value="20031201100101"/>
									<assignedPerson>
										<!-- provider who managed the issue -->
										<id root="2.16.840.1.113883.4.76" extension="555555"/>
										<!--  HealthcareProviderRoleType -->
										<code code="PSY"/> <!--don't believe PSY is correct code (removed it from the other providers) but leaving it in this one place for notation-->
										<representedPerson>
											<name use="L">
												<given>Tech</given>
												<family>Timmy</family>
											</name>
										</representedPerson>
									</assignedPerson>
								</author>
							</detectedIssueManagement>
						</mitigatedBy>
						<!-- severity of the issue -->
						<subjectOf>
							<severityObservation>
								<code code="SEV"/>
								<statusCode code="completed"/>
								<!-- SeverityObservation vocab,  A coded value denoting the gravity of the detected issue -->
								<value code="M"/> <!-- moderate -->
							</severityObservation>
						</subjectOf>
					</detectedIssueEvent>
				</subjectOf1>
				<!-- if the return notes flag was off on the query instead of returning the notes, PEI will simply use the presence or absence of this   element to comunicate whether notes are attached or not -->
				<subjectOf2>
					<subsetCode code="SUM"></subsetCode>
					<annotationIndicator>
						<statusCode code="completed"></statusCode>
					</annotationIndicator>
				</subjectOf2>
				<!-- 0..99 optional element for a note attached to the rx: notes now have language code, but have dropped code to indicate note type -->
				<subjectOf3>
					<annotation>
						<!-- Free text comments. Additional textual instructions entered about the dispense event. -->
						<text>Some textual observation about the dispense by the dispenser</text>
						<statusCode code="active"/>
						<languageCode code="EN"/>
						<author>
							<time value="20040101090101"/>
							<assignedPerson>
								<!-- id of provider who adds the note -->
								<id root="2.16.840.1.113883.4.15" extension="777777"/>
								<representedPerson>
									<name use="L">
										<given>Sue</given>
										<family>Script</family>
									</name>
								</representedPerson>
							</assignedPerson>
						</author>
					</annotation>
				</subjectOf3>

				<!-- 0..20 elements to show how the status of the rx has changed over timei.e. one element for every controlActEvent of every message that updated this entity-->
				<subjectOf4>
					<controlActEvent>
						<code></code>
						<statusCode></statusCode>
						<effectiveTime></effectiveTime>
						<author>
							<time></time>
							<assignedPerson>
								<id></id>
								<representedPerson>
									<name></name>
								</representedPerson>
							</assignedPerson>
						</author>
					</controlActEvent>
				</subjectOf4>
				<!-- an optional prescriber's instruction that a specific prescribed product be dispensed as is, or not. -->
				<subjectOf5>
					<substitutionPermission>
						<code code="G"></code> <!-- fixed value -->
						<!-- The reason why the prescriber has indicated that substitution is not allowed by the dispensing pharmacy: SubstanceAdminSubstitutionNotAllowedReason vocab -->
						<reasonCode code="ALGALT"/> <!-- allergy/intolerance -->
					</substitutionPermission>
				</subjectOf5>
				<!-- 0..10 elements to record any refusals to fill against the rx -->
				<subjectOf6>
					<refusalToFill>
						<code code="PORX_TE010210UV"/>
						<statusCode code="completed"/>
						<!-- Supports capture of reasons such as 'moral objection' which are not tied to specific issues.  Set to CWE to allow non-coded reasons: ActSupplyFulfillmentRefusalReason vocab -->
						<reasonCode code="1"/>
						<!-- Indicates who refused to fulfill the prescription -->
						<author>
							<!-- pharmacist or prescriber id  -->
							<assignedPerson>
								<id root="2.16.840.1.113883.4.15" extension="777777"/>
								<!--  HealthcareProviderRoleType -->
								<code code="PSY"/> <!--don't believe PSY is correct code (removed it from the other providers) but leaving it in this one place for notation-->
								<representedPerson>
									<name use="L">
										<given>Sue</given>
										<family>Script</family>
									</name>
								</representedPerson>
							</assignedPerson>
						</author>
						<location>
							<serviceDeliveryLocation>
								<!-- a pharmacy id -->
								<id root="2.16.840.1.113883.4.19" extension="123445"/>
								<addr>
									<city>Charlottetown</city>
									<state>PE</state>
									<postalCode>C1A5M7</postalCode>
									<country>Canada</country>
								</addr>
								<telecom use="H" value="tel:9023457823"/>
								<location>
									<name>Shopper's Drug Mart</name>
								</location>
							</serviceDeliveryLocation>
						</location>
						<!-- 0..5 elements for any detected issues associated with a prescription that resulted in a dispenser refusing to fill it -->
						<reason>
							<detectedIssueEvent>
								<!-- A coded value that is used to distinguish between different kinds of issues.  Types of issue include: unrecognized identifiers, permission issues, drug-drug contraindications, drug-allergy alerts, duplicate therapies,  suspect fraud  etc. -->
								<code code="INT"></code>
								<text>A free form textual description regarding the issue of fraudulence. This may be specified in place of, or in addition to the coded issue</text>
								<statusCode code="completed"/>
							</detectedIssueEvent>
						</reason>
					</refusalToFill>
				</subjectOf6>
				<!-- if the return issues flag was off on the query - PEI will use this element to communicate whether there are any issues if present Indicates  there are issues  -->
				<subjectOf7>
					<subsetCode code="SUM"></subsetCode>
					<detectedIssueIndicator>
						<statusCode code="completed"></statusCode>
					</detectedIssueIndicator>
				</subjectOf7>
				<!-- Indicates the clinical use category in which the prescription has been put -->
				<componentOf>
					<!-- Categorization of prescriptions based on the intended duration of the prescribed therapy -->
					<workingListEvent>
						<!-- Describes the categorization of the therapy envisioned by this prescription (e.g Continuous/Chronic, Short-Term/Acute and "As-Needed).Allows categorizing prescription for presentation. May influence detection of duplicate therapy.  May also be used to affect how DUR processing is completed.The field is marked as "populated" because the intended duration of the therapy should generally be known at prescribe time. However in some circumstances, it may not be known whether a therapy will be short-term or long-term ActTherapyDurationWorkingListCode vocab. -->
						<code code="PRN"/> <!--as needed-->
					</workingListEvent>
				</componentOf>
			</combinedMedicationRequest>
		</subject>
		<!-- issues element to communicate any problems with the query - i.e. lack of access to a keyword protected profile - not DUR issues in this case -->
	<subjectOf>
			<detectedIssueEvent>
				<code></code>
				<statusCode></statusCode>
				<priorityCode></priorityCode>
				<subjectOf>
					<severityObservation>
						<code></code>
						<statusCode></statusCode>
						<value></value>
					</severityObservation>
				</subjectOf>
			</detectedIssueEvent>
		</subjectOf>
		<queryAck>
			<queryId root="2.16.124.9.101.1.2.5" extension="123"/>
			<queryResponseCode code="OK"/>
			<resultTotalQuantity value="1"/>
			<resultCurrentQuantity value="1"/>
			<resultRemainingQuantity value="0"/>
		</queryAck>
		<queryByParameter>
			<queryId root="2.16.124.9.101.1.8.5" extension="123"/>
			<parameterList>
				<!-- Indicates that the returned records should be filtered to only include those which have been changed in some way (had status changed, been annotated, prescription was dispensed, etc.) within the indicated time-period.  This will commonly  be used to 'retrieve everything that has been changed since xxx' -->
				<amendedInTimeRange>
					<value>
						<low value="20030101"/>
						<high value="20040101"/>
					</value>
				</amendedInTimeRange>
				<!-- Indicates whether or not history of selected medication records are to be returned along with the detailed information. -->
				<includeEventHistoryIndicator>
					<value value="false"/>
				</includeEventHistoryIndicator>
				<!-- required element that indicates whether or not issues (detected and/or managed)  attached to the rx records are to be returned along with the detailed information. -->
				<includeIssuesIndicator>
					<value value="false"/>
				</includeIssuesIndicator>
				<!-- Indicates whether or not notes attached to the selected rx records are to be returned along with the detailed information  -->
				<includeNotesIndicator>
					<value value="true"/>
				</includeNotesIndicator>
				<!-- Indicates whether to include future changes (e.g. status changes that aren't effective yet)  associated with a prescriptionorder and/or prescription dispense are to be returned along with the detailed information  -->
				<includePendingChangesIndicator>
					<value value="false"/>
				</includePendingChangesIndicator>
				<!-- required values to identify the patient -->
				<patientBirthDate>
					<value value="19670405"/>
				</patientBirthDate>
				<patientGender>
					<value code="F"/>
				</patientGender>
				<patientID>
					<value root="2.16.840.1.113883.4.13" extension="999999999"/>
				</patientID>
				<patientName>
					<value>
						<given>Patti</given>
						<family>Patient</family>
					</value>
				</patientName>
				<!-- Identifier of the prescription for which detailed information is required. -->
				<prescriptionOrderNumber>
					<value root="2.16.124.9.101.1.1.4" extension="222222"/>
				</prescriptionOrderNumber>
			</parameterList>
		</queryByParameter>
	</controlActEvent>
</PORX_IN060260CA>