Making Electronic Data More available for Research and Public Health (MedMorph)
1.0.0 - STU 1

Making Electronic Data More available for Research and Public Health (MedMorph), published by HL7 International - Public Health Work Group. This is not an authorized publication; it is the continuous build for version 1.0.0). This version is based on the current content of https://github.com/HL7/fhir-medmorph/ and changes regularly. See the Directory of published versions

## : Plan Definition example for MedMorph - XML Representation

Active as of 2020-07-31

Raw xml | Download

    <PlanDefinition xmlns="http://hl7.org/fhir">
      <id value="medmorph-plandefinition-example"/>
      <meta>
        <profile
                 value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-plandefinition"/>
        <profile
                 value="http://hl7.org/fhir/us/medmorph/StructureDefinition/medmorph-plandefinition"/>
      </meta>
      <text>
        <status value="extensions"/>
        <div xmlns="http://www.w3.org/1999/xhtml"><p><b>MedMorph PlanDefinition Example</b></p></div>
      </text>
      <extension
                 url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-receiver-jwks-url">
        <valueUrl value="http://example.org/jwks/123"/>
      </extension>
      <extension
                 url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-data-encryption-algorithm">
        <valueCode value="RSA384"/>
      </extension>
      <url
           value="http://hl7.org/fhir/us/medmorph/StructureDefinition/medmorph-plandefinition-example"/>
      <version value="1.0.0"/>
      <name value="MedMorphPlanDefinitionExample"/>
      <title value="MedMorph PlanDefinition Example"/>
      <type>
        <coding>
          <system
                  value="http://terminology.hl7.org/CodeSystem/plan-definition-type"/>
          <code value="workflow-definition"/>
          <display value="Workflow Definition"/>
        </coding>
      </type>
      <status value="active"/>
      <experimental value="true"/>
      <date value="2020-07-31T12:32:29.858-05:00"/>
      <publisher value="HL7 International - Public Health Work Group"/>
      <contact>
        <telecom>
          <system value="url"/>
          <value value="http://hl7.org/Special/committees/pher"/>
        </telecom>
      </contact>
      <description value="An example MedMorph PlanDefinition"/>
      <jurisdiction>
        <coding>
          <system value="urn:iso:std:iso:3166"/>
          <code value="US"/>
        </coding>
      </jurisdiction>
      <effectivePeriod>
        <start value="2020-12-01"/>
      </effectivePeriod>
      <relatedArtifact>
        <type value="depends-on"/>
        <label value="Value Set Library of Trigger Codes"/>
        <resource
                  value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
      </relatedArtifact>
      <action id="start-workflow">
        <description
                     value="This action represents the start of the reporting workflow in response to the encounter-start event. Other named events can be used instead of encounter-start."/>
        <textEquivalent
                        value="Start the reporting workflow in response to an encounter-start event"/>
        <code>
          <coding>
            <system
                    value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
            <code value="initiate-reporting-workflow"/>
            <display value="Initiate a reporting workflow"/>
          </coding>
        </code>
        <trigger id="encounter-start">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-named-eventtype">
            <valueCodeableConcept>
              <coding>
                <system
                        value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-triggerdefinition-namedevents"/>
                <code value="encounter-start"/>
                <display value="Indicates the start of an encounter"/>
              </coding>
            </valueCodeableConcept>
          </extension>
          <type value="named-event"/>
          <name value="encounter-start"/>
        </trigger>
        <input id="patient">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
            <valueString value="Patient/{{context.patientId}}"/>
          </extension>
          <type value="Patient"/>
        </input>
        <input id="encounter">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
            <valueString value="Encounter/{{context.encounterId}}"/>
          </extension>
          <type value="Encounter"/>
        </input>
        <relatedAction>
          <actionId value="check-reportability"/>
          <relationship value="before-start"/>
          <offsetDuration>
            <value value="60"/>
            <system value="http://unitsofmeasure.org"/>
            <code value="s"/>
          </offsetDuration>
        </relatedAction>
      </action>
      <action id="check-reportability">
        <description
                     value="This action represents the start of the check for reportable conditions in response to the encounter-start event. This is an example of executing a reporting workflow with other actions."/>
        <textEquivalent
                        value="Check Reportability and setup jobs for future reportability checks."/>
        <code>
          <coding>
            <system
                    value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
            <code value="execute-reporting-workflow"/>
          </coding>
        </code>
        <action id="is-encounter-reportable">
          <description
                       value="This action represents the check for reportability to create the Report."/>
          <textEquivalent value="Check Trigger Codes based on Value sets."/>
          <code>
            <coding>
              <system
                      value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
              <code value="check-trigger-codes"/>
            </coding>
          </code>
          <condition>
            <kind value="applicability"/>
            <expression>
              <language value="text/fhirpath"/>
              <expression
                          value="%encounter.where(%encounterStartDate + 1 day * %normalReportingDuration &gt;= now()).select(true) and (%conditions.exists() or %encounters.exists() or %immunizations.exists() or %procedures.exists() or %procedureOrders.exists() or %labOrders.exists() or %labTests.exists() or %labResults.exists() or %medicationAdministrations.exists() or %medicationOrders.exists() or %medicationDispenses.exists())"/>
            </expression>
          </condition>
          <input id="conditions">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="Condition?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="Condition"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="encounters">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
              <valueString value="encounter"/>
            </extension>
            <type value="Encounter"/>
            <codeFilter>
              <path value="reasonCode"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="immunizations">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="Immunization?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="Immunization"/>
            <codeFilter>
              <path value="vaccineCode"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="labOrders">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="ServiceRequest?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="ServiceRequest"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="labTests">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="Observation?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="Observation"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="diagnosticOrders">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="DiagnosticReport?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="DiagnosticReport"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="procedureOrders">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="ServiceRequest?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="ServiceRequest"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="procedures">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="Procedure?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="Procedure"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="medicationOrders">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="MedicationRequest?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="MedicationRequest"/>
            <codeFilter>
              <path value="medication"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="medicationDispenses">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="MedicationDispense?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="MedicationDispense"/>
            <codeFilter>
              <path value="medication"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="medicationAdministrations">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-fhirquerypattern-extension">
              <valueString
                           value="MedicationAdministration?patient=Patient/{{context.patientId}}"/>
            </extension>
            <type value="MedicationAdministration"/>
            <codeFilter>
              <path value="medication"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="labResults">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
              <valueString value="labTests"/>
            </extension>
            <type value="Observation"/>
            <codeFilter>
              <path value="value"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <input id="diagnosticResults">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
              <valueString value="diagnosticOrders"/>
            </extension>
            <type value="DiagnosticReport"/>
            <codeFilter>
              <path value="code"/>
              <valueSet
                        value="http://hl7.org/fhir/us/medmorph/ValueSet/valueset-cancer-trigger-codes-example"/>
            </codeFilter>
          </input>
          <relatedAction>
            <actionId value="create-report"/>
            <relationship value="before-start"/>
          </relatedAction>
        </action>
      </action>
      <action id="create-report">
        <description
                     value="This action represents the creation of the Report. It subsequently calls validate."/>
        <textEquivalent value="Create Report"/>
        <code>
          <coding>
            <system
                    value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
            <code value="create-report"/>
          </coding>
        </code>
        <input id="patientdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="patient"/>
          </extension>
          <type value="Patient"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"/>
        </input>
        <input id="conditiondata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="conditions"/>
          </extension>
          <type value="Condition"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"/>
        </input>
        <input id="encounterdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="encounter"/>
          </extension>
          <type value="Encounter"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"/>
        </input>
        <input id="mrdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="medicationOrders"/>
          </extension>
          <type value="MedicationRequest"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"/>
        </input>
        <input id="immzdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="immunizations"/>
          </extension>
          <type value="Immunization"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"/>
        </input>
        <input id="procdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="procedures"/>
          </extension>
          <type value="Procedure"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"/>
        </input>
        <input id="labResultdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="labResults"/>
          </extension>
          <type value="Observation"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"/>
        </input>
        <input id="labOrderdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="labOrders"/>
          </extension>
          <type value="ServiceRequest"/>
          <profile
                   value="http://hl7.org/fhir/StructureDefinition/ServiceRequest"/>
        </input>
        <input id="diagnosticResultdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="diagnosticResults"/>
          </extension>
          <type value="DiagnosticReport"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"/>
        </input>
        <input id="diagnosticOrderdata">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="diagnosticOrders"/>
          </extension>
          <type value="DiagnosticReport"/>
          <profile
                   value="http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"/>
        </input>
        <output id="output-report">
          <type value="Bundle"/>
          <profile
                   value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
        </output>
        <relatedAction>
          <actionId value="validate-report"/>
          <relationship value="before-start"/>
        </relatedAction>
        <action id="anonymize-report">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-trust-service-endpoint">
            <valueReference>
              <reference value="Endpoint/example-ph-endpoint"/>
            </valueReference>
          </extension>
          <description
                       value="This action is used to anonymize a identifiable report"/>
          <textEquivalent value="Anonymize the report."/>
          <code>
            <coding>
              <system
                      value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
              <code value="anonymize-report"/>
            </coding>
          </code>
          <input id="report-to-be-anonymized">
            <extension
                       url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
              <valueString value="output-report"/>
            </extension>
            <type value="Bundle"/>
          </input>
          <output id="anonymized-report">
            <type value="Bundle"/>
            <profile
                     value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
          </output>
        </action>
      </action>
      <action id="validate-report">
        <description
                     value="This action represents the validation of the Report. It subsequently calls route-and-send."/>
        <textEquivalent value="Validate Report"/>
        <code>
          <coding>
            <system
                    value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
            <code value="validate-report"/>
          </coding>
        </code>
        <input id="generated-report">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="output-report"/>
          </extension>
          <type value="Bundle"/>
          <profile
                   value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
        </input>
        <output id="valid-report">
          <type value="Bundle"/>
          <profile
                   value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
        </output>
        <relatedAction>
          <actionId value="route-and-send-report"/>
          <relationship value="before-start"/>
        </relatedAction>
      </action>
      <action id="route-and-send-report">
        <description
                     value="This action represents the routing and sending of the Report."/>
        <textEquivalent value="Route and send Report"/>
        <code>
          <coding>
            <system
                    value="http://hl7.org/fhir/us/medmorph/CodeSystem/us-ph-plandefinition-actions"/>
            <code value="submit-report"/>
          </coding>
        </code>
        <input id="validated-report">
          <extension
                     url="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-relateddata-extension">
            <valueString value="valid-report"/>
          </extension>
          <type value="Bundle"/>
          <profile
                   value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
        </input>
        <output id="submitted-report">
          <type value="Bundle"/>
          <profile
                   value="http://hl7.org/fhir/us/medmorph/StructureDefinition/us-ph-reporting-bundle"/>
        </output>
      </action>
    </PlanDefinition>