<OperationDefinition xmlns="http://hl7.org/fhir"> <id value="-s-create-episode-of-care"/> <text> <status value="generated"/> <div xmlns="http://www.w3.org/1999/xhtml"><h2>create-episode-of-care</h2><p>OPERATION: create-episode-of-care</p><p>The official URL for this operation definition is: </p><pre>http://ehealth.sundhed.dk/fhir/OperationDefinition/-s-create-episode-of-care</pre><div><p>This operation persists an EpisodeOfCare based on the transient value of an EpisodeOfCare provided in the input.</p> <h2>Input</h2> <p>The input is a Bundle which must contain exactly one EpisodeOfCare and at least one Provenance resource. All Provenances in the input must have the EpisodeOfCare as target. At least one Provenance must interprete into a 'Privacy-provenance' (see below).</p> <h3>The EpisodeOfCare resource</h3> <p>The 'id' property of the EpisodeOfCare will be reassigned by the server, but can be referenced by other resources in the same bundle. The 'managingOrganization' property of the EpisodeOfCare references the GDPR Data Controller (Danish: 'Dataansvarlig').</p> <h3>The privacy-Provenance resource</h3> <p>A privacy-Provenance is a Provenance resource characterized by having at least two entries in Provenance.policy of which the first indicates the category of registered persons, for which data are transported, stored, or processed as a result of this transaction. Possible values are:</p> <ul> <li>'http://ehealth.sundhed.dk/policy/ehealth/patient-data' (Danish: Person- og patientdata)</li> <li>'http://ehealth.sundhed.dk/policy/ehealth/supplier-data' (Danish: Leverandørdata)</li> <li>'http://ehealth.sundhed.dk/policy/ehealth/practitioner-data' (Danish: Medarbejderdata)</li> </ul> <p>At least one other policy must be stated in Provenance.policy to indicate the legal basis on which data are transported, stored, or processed in the system. Possible values are:</p> <ul> <li>'http://ehealth.sundhed.dk/policy/dk/sundhedsloven-0.6.0'</li> <li>'http://ehealth.sundhed.dk/policy/dk/persondataloven-0.6.0'</li> <li>'http://ehealth.sundhed.dk/policy/dk/sikkerhedsbekendtgørelsen-0.6.0'</li> <li>'http://ehealth.sundhed.dk/policy/dk/databeskyttelsesloven-0.6.0'</li> <li>'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation-0.6.0'</li> </ul> <h3>Diagnosis referenced Condition resource</h3> <p>For any diagnosis listed, the referenced Condition must be concerning the same Patient as the EpisodeOfCare.</p> <h2>Output</h2> <p>For valid inputs, the server will create, persist and return a new EpisodeOfCare carrying a server-assigned id.</p> <h3>The origin-Provenance resource</h3> <p>Whenever an EpisodeOfCare is created, the server automatically creates an 'origin' Provenance resource point to it (in addition to the client-supplied Privacy-Provenance). This Origin-Provenance resource is filled with data from the JWT access token in order to record the origin of the EpisodeOfCare resource. For instance agent.whoReference may point to a resource which is created as a shadow identity from the JWT token, if a matching resource is not already found in the system.</p> <h2>Examples</h2> <h3>Input</h3> <pre><code>{ 'resourceType': 'Bundle', 'type': 'transaction', 'entry': [ { 'resource': { 'resourceType': 'Provenance', 'id': '1', 'target': [ { 'reference': '#2' } ], 'recorded': '2019-04-11T12:50:24+02:00', 'policy': [ 'http://ehealth.sundhed.dk/policy/ehealth/patient-data', 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation' ], 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'RESP' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421' } } ] }, 'request': { 'method': 'POST', 'url': 'Provenance' } }, { 'resource': { 'resourceType': 'EpisodeOfCare', 'id': 2, 'status': 'planned', 'diagnosis': [ { 'condition': { 'reference': 'http://ehealth.sundhed.dk/careplan/fhir/Condition/1678072' } } ], 'patient': { 'reference': 'Patient/4072' }, 'managingOrganization': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71' }, 'period': { 'start': '1970-01-01T01:00:01+01:00', 'end': '2099-01-01T01:01:40+01:00' } }, 'request': { 'method': 'POST', 'url': 'EpisodeOfCare' } } ] } </code></pre> <h3>Output</h3> <pre><code>{ 'resourceType': 'Bundle', 'type': 'transaction', 'entry': [ { 'resource': { 'resourceType': 'Provenance', 'id': '849028939', 'target': [ { 'reference': '' } ], 'recorded': '2019-04-11T12:50:24+02:00', 'policy': [ 'http://ehealth.sundhed.dk/policy/ehealth/patient-data', 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation' ], 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'RESP' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421' } } ] }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028939' } }, { 'resource': { 'resourceType': 'Provenance', 'id': '849028940', 'target': [ { 'reference': 'EpisodeOfCare/298359' } ], 'recorded': '2019-04-11T17:50:24+02:00', 'reason': [ { 'system': 'http://hl7.org/fhir/v3/ActReason', 'code': 'PATADMIN' } ], 'activity': { 'system': 'http://hl7.org/fhir/v3/DataOperation', 'code': 'CREATE' }, 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'ENT' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/4241545' } } ] }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028940' } }, { 'resource': { 'resourceType': 'EpisodeOfCare', 'id': '298359', 'status': 'planned', 'diagnosis': [ { 'condition': { 'reference': 'http://ehealth.sundhed.dk/careplan/fhir/Condition/1678072' } } ], 'patient': { 'reference': 'Patient/4072' }, 'managingOrganization': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71' }, 'period': { 'start': '1970-01-01T01:00:01+01:00', 'end': '2099-01-01T01:01:40+01:00' } }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/episodeofcare/fhir/EpisodeOfCare/78954' } } ] } </code></pre> </div><p>URL: [base]/$create-episode-of-care</p><p>Parameters</p><table class="grid"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>episodeOfCareAndProvenances</td><td>1..1</td><td><a href="http://hl7.org/fhir/STU3/bundle.html">Bundle</a></td><td/><td/></tr><tr><td>OUT</td><td>return</td><td>0..1</td><td><a href="http://hl7.org/fhir/STU3/bundle.html">Bundle</a></td><td/><td/></tr></table></div> </text> <url value="http://ehealth.sundhed.dk/fhir/OperationDefinition/-s-create-episode-of-care"/> <version value="2019.5.3"/> <name value="create-episode-of-care"/> <status value="active"/> <kind value="operation"/> <date value="2019-06-07T11:10:06+00:00"/> <description value="This operation persists an EpisodeOfCare based on the transient value of an EpisodeOfCare provided in the input. ## Input The input is a Bundle which must contain exactly one EpisodeOfCare and at least one Provenance resource. All Provenances in the input must have the EpisodeOfCare as target. At least one Provenance must interprete into a 'Privacy-provenance' (see below). ### The EpisodeOfCare resource The 'id' property of the EpisodeOfCare will be reassigned by the server, but can be referenced by other resources in the same bundle. The 'managingOrganization' property of the EpisodeOfCare references the GDPR Data Controller (Danish: 'Dataansvarlig'). ### The privacy-Provenance resource A privacy-Provenance is a Provenance resource characterized by having at least two entries in Provenance.policy of which the first indicates the category of registered persons, for which data are transported, stored, or processed as a result of this transaction. Possible values are: - 'http://ehealth.sundhed.dk/policy/ehealth/patient-data' (Danish: Person- og patientdata) - 'http://ehealth.sundhed.dk/policy/ehealth/supplier-data' (Danish: Leverandørdata) - 'http://ehealth.sundhed.dk/policy/ehealth/practitioner-data' (Danish: Medarbejderdata) At least one other policy must be stated in Provenance.policy to indicate the legal basis on which data are transported, stored, or processed in the system. Possible values are: - 'http://ehealth.sundhed.dk/policy/dk/sundhedsloven-0.6.0' - 'http://ehealth.sundhed.dk/policy/dk/persondataloven-0.6.0' - 'http://ehealth.sundhed.dk/policy/dk/sikkerhedsbekendtgørelsen-0.6.0' - 'http://ehealth.sundhed.dk/policy/dk/databeskyttelsesloven-0.6.0' - 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation-0.6.0' ### Diagnosis referenced Condition resource For any diagnosis listed, the referenced Condition must be concerning the same Patient as the EpisodeOfCare. ## Output For valid inputs, the server will create, persist and return a new EpisodeOfCare carrying a server-assigned id. ### The origin-Provenance resource Whenever an EpisodeOfCare is created, the server automatically creates an 'origin' Provenance resource point to it (in addition to the client-supplied Privacy-Provenance). This Origin-Provenance resource is filled with data from the JWT access token in order to record the origin of the EpisodeOfCare resource. For instance agent.whoReference may point to a resource which is created as a shadow identity from the JWT token, if a matching resource is not already found in the system. ## Examples ### Input ``` { 'resourceType': 'Bundle', 'type': 'transaction', 'entry': [ { 'resource': { 'resourceType': 'Provenance', 'id': '1', 'target': [ { 'reference': '#2' } ], 'recorded': '2019-04-11T12:50:24+02:00', 'policy': [ 'http://ehealth.sundhed.dk/policy/ehealth/patient-data', 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation' ], 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'RESP' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421' } } ] }, 'request': { 'method': 'POST', 'url': 'Provenance' } }, { 'resource': { 'resourceType': 'EpisodeOfCare', 'id': 2, 'status': 'planned', 'diagnosis': [ { 'condition': { 'reference': 'http://ehealth.sundhed.dk/careplan/fhir/Condition/1678072' } } ], 'patient': { 'reference': 'Patient/4072' }, 'managingOrganization': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71' }, 'period': { 'start': '1970-01-01T01:00:01+01:00', 'end': '2099-01-01T01:01:40+01:00' } }, 'request': { 'method': 'POST', 'url': 'EpisodeOfCare' } } ] } ``` ### Output ``` { 'resourceType': 'Bundle', 'type': 'transaction', 'entry': [ { 'resource': { 'resourceType': 'Provenance', 'id': '849028939', 'target': [ { 'reference': '' } ], 'recorded': '2019-04-11T12:50:24+02:00', 'policy': [ 'http://ehealth.sundhed.dk/policy/ehealth/patient-data', 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation' ], 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'RESP' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421' } } ] }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028939' } }, { 'resource': { 'resourceType': 'Provenance', 'id': '849028940', 'target': [ { 'reference': 'EpisodeOfCare/298359' } ], 'recorded': '2019-04-11T17:50:24+02:00', 'reason': [ { 'system': 'http://hl7.org/fhir/v3/ActReason', 'code': 'PATADMIN' } ], 'activity': { 'system': 'http://hl7.org/fhir/v3/DataOperation', 'code': 'CREATE' }, 'agent': [ { 'role': [ { 'coding': [ { 'system': 'http://hl7.org/fhir/v3/ParticipationType', 'code': 'ENT' } ] } ], 'whoReference': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/4241545' } } ] }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028940' } }, { 'resource': { 'resourceType': 'EpisodeOfCare', 'id': '298359', 'status': 'planned', 'diagnosis': [ { 'condition': { 'reference': 'http://ehealth.sundhed.dk/careplan/fhir/Condition/1678072' } } ], 'patient': { 'reference': 'Patient/4072' }, 'managingOrganization': { 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71' }, 'period': { 'start': '1970-01-01T01:00:01+01:00', 'end': '2099-01-01T01:01:40+01:00' } }, 'response': { 'status': '200 OK', 'location': 'http://ehealth.sundhed.dk/episodeofcare/fhir/EpisodeOfCare/78954' } } ] } ``` "/> <idempotent value="false"/> <code value="create-episode-of-care"/> <system value="true"/> <type value="false"/> <instance value="false"/> <parameter> <name value="episodeOfCareAndProvenances"/> <use value="in"/> <min value="1"/> <max value="1"/> <type value="Bundle"/> </parameter> <parameter> <name value="return"/> <use value="out"/> <min value="0"/> <max value="1"/> <type value="Bundle"/> </parameter> </OperationDefinition>