<!-- ENV13606-3 Distribution Rule XML DTD -->

<!-- version x0.4 aligned for inclusion as part of ProvideEhcr.dtd
     Modified by David Markwell 1999-06-05 from 0.3 by Adam Back
     Will not operate standalone as it requires entities
     defined in or referenced by the parent ProvideEhcr.dtd
-->

<!-- distribution rule reference (#I01334) -->
<!ELEMENT DistRuleRef (DistRuleUid,
		DistRuleAppliedDate,
		DistRuleAppliedBy,
		DistRuleValidFrom?,
		DistRuleValidTo?,
		DistRuleInvalidatedBy?,
		DistRuleNegationStatement,
		DistRuleBasicDistRule,
		DistRuleCountryApplication?,
		DistRuleConsentDemoRef?)>


<!--A distribution rule reference applies a referenced distribution
  rule to an EHCR message component. -->

<!ELEMENT DistRuleInvalidatedBy (AgentCtxId)>

<!ELEMENT DistRuleAppliedBy (AgentCtxId)>

<!-- DR applied date and time (#I01611) -->
<!ELEMENT DistRuleAppliedDate (#PCDATA)>


<!--The date and time the distribution rule was applied to the
  architectural component. -->

<!-- DR basic distribution rule (#I01617) -->
<!ELEMENT DistRuleBasicDistRule (#PCDATA)>


<!--A functional flag that represents that the distribution rule is
  applied as a basic distribution rule to the EHCR message component.
  If one or more basic distribution rules are applied to an EHCR
  message component, it shall not be possible to apply any non-basic
  distribution rule if its contents do not comply with one or more of
  the basic distribution rules.
 -->

<!-- DR consent demonstration reference (#I01619) -->
<!ELEMENT DistRuleConsentDemoRef (IdType?,
		IdScheme?,
		IdValue)>


<!--If this distribution rule is applied to the EHCR message
  component as a healthcare person's demonstration of consent according
  to an existing, applied distribution rule, this attribute shall
  contain a reference to that distribution rule.
 -->

<!-- DR negation statement (#I01616) -->
<!ELEMENT DistRuleNegationStatement (#PCDATA)>


<!--A functional flag that informs the information system that the
  contents of the rule of which this is a part shall both be
  interpreted as a disabling mechanism and take precedence over all
  enabling rules containing any of the same distribution rule
  components applied to this EHCR message component.
 -->

<!-- distribution rule unique identifier (#I01606) -->
<!ELEMENT DistRuleUid (IdType?,
		IdScheme?,
		IdValue)>


<!--If this distribution rule is applied to the architectural
  component as a healthcare persons demonstration of consent according
  to an existing, applied distribution rule, this attribute shall
  contain a reference to that distribution rule.
 -->

<!-- DR valid from (#I01613) -->
<!ELEMENT DistRuleValidFrom (#PCDATA)>


<!--The date and time the distribution rule first may be used for
  accessing the architectural component. If not present, it may be used
  from the time of application.
 -->

<!-- DR valid to (#I01614) -->
<!ELEMENT DistRuleValidTo (#PCDATA)>


<!--The date and time the distribution rule will cease be used in
  connection with the architectural component. If not present, there
  are no time limitations for its use.
 -->

<!-- DR country of application (#I01618) -->

<!ELEMENT DistRuleCountryApplication (%Coded;)>
<!ATTLIST DistRuleCountryApplication ICSI CDATA #IMPLIED>


<!--Coded data representation of the country in which the
  distribution rule was applied to the EHCR message component.
Attributes of DistRuleCountryApplication
 ICSI: ICSI (#I00010)
  International Coding Scheme Identifier identifying the coding
  scheme from which the associated code value is derived.
 -->

<!ELEMENT DistRuleConsentDemonstrationRef (Id)>

<!-- DistributionRule-->

<!ELEMENT DistRule (DistRuleUid,
 		DistRuleAccessType?,
 		DistRuleApplyDrAccess?,
		DistRuleWho*, 
		DistRuleWhen?, 
		DistRuleWhere*, 
		DistRuleWhy+, 
		DistRuleHow*,
 		DistRuleAuthor)>

<!ELEMENT DistRuleAccessType (#PCDATA)>

<!ELEMENT DistRuleApplyDrAccess (#PCDATA)>
<!ELEMENT DistRuleAuthor (AgentCtxId)>

<!-- WHO -->

<!ELEMENT DistRuleWho (DistRuleProfession?,
		DistRuleSpecialisation?,
		AgentCtxId?,
		DistRuleEngagedInCare)>

<!-- AgentCtxId is identifier that references the healthcare agent    
    engagedInCare flag representing that the data user is currently    
    involved in the provision of care to the Subject    
    of Care to whom the information contained within    
    Record relates -->

<!ELEMENT DistRuleProfession (%Coded;)>
<!ATTLIST DistRuleProfession ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleSpecialisation (%Coded;)>
<!ATTLIST DistRuleSpecialisation ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleEngagedInCare (#PCDATA)>

<!-- WHEN-->

<!ELEMENT DistRuleWhen (DistRuleEpisodeOfCare,
		DistRuleEpisodeRef?,
		DistRuleEpisodeDescription?)>

<!-- Value of %boolean; equals TRUE when time of access will
    be within an episode of care with respect to the
    subject of care to whom the data contained within
    record relates 
-->

<!-- episodeReference is a pointer to an episode refernce number within an    
    architecure that supports data groupings in episodes of care -->

<!ELEMENT DistRuleEpisodeOfCare (#PCDATA)>
<!ELEMENT DistRuleEpisodeRef (Id)>
<!ELEMENT DistRuleEpisodeDescription (#PCDATA)>
<!ATTLIST DistRuleEpisodeDescription xml:lang CDATA #IMPLIED>

<!-- WHERE-->

<!ELEMENT DistRuleWhere (DistRuleCountrySpecificity*,
		DistRuleLegalRequirement)>
<!-- LegalRequirement %boolean; value TRUE equals that the
	Distribution Rule of which it is attached is a legal
	requirement in the country in which the rule was applied -->

<!ELEMENT DistRuleCountrySpecificity (%Coded;)>
<!ATTLIST DistRuleCountrySpecificity ICSI CDATA #IMPLIED>
<!ELEMENT DistRuleLegalRequirement (#PCDATA)>

<!-- WHY -->

<!ELEMENT DistRuleWhy (DistRuleProcess?,
		DistRuleSensitivityClass?,
		DistRulePurposeOfUse?,
		DistRuleSubjectOfCare,
		DistRulePartyRole?)>

<!-- The Object Why should be regarded as mandatory with its attributes as    
    conditional. That is, that according to this European Prestandard the    
    object Why shall be present, however the value of its objects and    
    attributes are optional so long as one is present. -->

<!ELEMENT DistRuleSensitivityClass (%Coded;)>
<!ATTLIST DistRuleSensitivityClass ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleSubjectOfCare (#PCDATA)>

<!-- HOW -->

<!ELEMENT DistRuleHow (DistRuleAccessMethod?,
		DistRuleThirdPartyConsent?,
		DistRuleSecurityPolicy?)>

<!ELEMENT DistRuleAccessMethod (%Coded;)>
<!ATTLIST DistRuleAccessMethod ICSI CDATA #IMPLIED>

<!-- PurposeOfUse    -->

<!ELEMENT DistRulePurposeOfUse (DistRulePurposeOfUseCode,
		DistRuleText?,
		DistRuleSpecificPurposeOfUse?,
		DistRuleActivity?)>

<!ELEMENT DistRulePurposeOfUseCode (%Coded;)>
<!ATTLIST DistRulePurposeOfUseCode ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleSpecificPurposeOfUse (%Coded;)>
<!ATTLIST DistRuleSpecificPurposeOfUse ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleActivity (%Coded;)>
<!ATTLIST DistRuleActivity ICSI CDATA #IMPLIED>


<!-- PartyRole-->

<!ELEMENT DistRulePartyRole (DistRuleText?,
		DistRulePartyRoles*)>

<!ELEMENT DistRuleText (#PCDATA)>
<!ATTLIST DistRuleText xml:lang CDATA #IMPLIED>

<!ELEMENT DistRulePartyRoles (%Coded;)>
<!ATTLIST DistRulePartyRoles ICSI CDATA #IMPLIED>


<!-- SecurityPolicy  -->

<!ELEMENT DistRuleSecurityPolicy (DistRuleText?,
		DistRuleSigned,
		DistRuleEncryptedDistribution,
		DistRuleEncryptedStorage,
		DistRuleOperatingSytemSecurityRating?,
		DistRulePhysicalSecurityRating?,
		DistRuleSoftwareSecurityRating?)>

<!-- for signed True equals data is signed using methodology defined    
    within PKCS7 Ver3 before distribution    
    for encryptedDistribution True equals data is encrypted before    
    using methodology defined within PKCS7 Ver3 before distribution    
    encryptedStorage: True equals data shall be encrypted using    
    methodology defined in PKCS#7 Ver3 when stored following distribution -->

<!ELEMENT DistRuleSigned (#PCDATA)>

<!ELEMENT DistRuleEncryptedDistribution (#PCDATA)>

<!ELEMENT DistRuleEncryptedStorage (#PCDATA)>

<!ELEMENT DistRuleOperatingSytemSecurityRating (%Coded;)>
<!ATTLIST DistRuleOperatingSytemSecurityRating ICSI CDATA #IMPLIED>

<!ELEMENT DistRulePhysicalSecurityRating (%Coded;)>
<!ATTLIST DistRulePhysicalSecurityRating ICSI CDATA #IMPLIED>

<!ELEMENT DistRuleSoftwareSecurityRating (%Coded;)>
<!ATTLIST DistRuleSoftwareSecurityRating ICSI CDATA #IMPLIED>


<!-- ThirdPartyConsent  -->

<!ELEMENT DistRuleThirdPartyConsent (AgentCtxId?,
		DistRuleConsentMethodCode?,
		DistRuleText?,
		DistRulePartyRole?)>

<!ELEMENT DistRuleConsentMethodCode (%Coded;)>
<!ATTLIST DistRuleConsentMethodCode ICSI CDATA #IMPLIED>


<!-- AccessLogItem   -->

<!ELEMENT DistRuleAccessLogItem (DistRuleCertificate?,
		DistRulePurposeOfUse?,
		DistRuleAccessType,
		DistRuleAccessMethod?,
		DistRuleAccessStatus,
		DistRuleTimeOfAccess,
		DistRuleArchitecturalComponentUid,
		AgentInContext?,
		DistRuleUid)>

<!-- Certificate contains the X509 Ver3 Certificate    
    of the entity who has accessed the data contained    
    within Record -->

<!ELEMENT DistRuleCertificate (#PCDATA)>

<!ELEMENT DistRuleAccessStatus (#PCDATA)>

<!ELEMENT DistRuleTimeOfAccess (#PCDATA)>

<!ELEMENT DistRuleArchitecturalComponentUid (Cuid)>

<!ELEMENT DistRuleProcess (%Coded;)>
<!ATTLIST DistRuleProcess ICSI CDATA #IMPLIED>

