{ "resourceType" : "OperationDefinition", "id" : "-s-create-episode-of-care", "text" : { "status" : "generated", "div" : "<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>\n<h2>Input</h2>\n<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>\n<h3>The EpisodeOfCare resource</h3>\n<p>The 'id' property of the EpisodeOfCare will be reassigned by the server, but can be referenced by other resources in the same bundle.\nThe 'managingOrganization' property of the EpisodeOfCare references the GDPR Data Controller (Danish: 'Dataansvarlig').</p>\n<h3>The privacy-Provenance resource</h3>\n<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>\n<ul>\n<li>'http://ehealth.sundhed.dk/policy/ehealth/patient-data' (Danish: Person- og patientdata)</li>\n<li>'http://ehealth.sundhed.dk/policy/ehealth/supplier-data' (Danish: Leverandørdata)</li>\n<li>'http://ehealth.sundhed.dk/policy/ehealth/practitioner-data' (Danish: Medarbejderdata)</li>\n</ul>\n<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>\n<ul>\n<li>'http://ehealth.sundhed.dk/policy/dk/sundhedsloven-0.6.0'</li>\n<li>'http://ehealth.sundhed.dk/policy/dk/persondataloven-0.6.0'</li>\n<li>'http://ehealth.sundhed.dk/policy/dk/sikkerhedsbekendtgørelsen-0.6.0'</li>\n<li>'http://ehealth.sundhed.dk/policy/dk/databeskyttelsesloven-0.6.0'</li>\n<li>'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation-0.6.0'</li>\n</ul>\n<h2>Output</h2>\n<p>For valid inputs, the server will create, persist and return a new EpisodeOfCare carrying a server-assigned id.</p>\n<h3>The origin-Provenance resource</h3>\n<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>\n<h2>Examples</h2>\n<h3>Input</h3>\n<pre><code>{\n 'resourceType': 'Bundle',\n 'type': 'transaction',\n 'entry': [\n {\n 'resource': {\n 'resourceType': 'Provenance',\n 'id': '1',\n 'target': [\n {\n 'reference': '#2'\n }\n ],\n 'recorded': '2019-04-11T12:50:24+02:00',\n 'policy': [\n 'http://ehealth.sundhed.dk/policy/ehealth/patient-data',\n 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation'\n ],\n 'agent': [\n {\n 'role': [\n {\n 'coding': [\n {\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\n 'code': 'RESP'\n }\n ]\n }\n ],\n 'whoReference': {\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421'\n }\n }\n ]\n },\n 'request': {\n 'method': 'POST',\n 'url': 'Provenance'\n }\n },\n {\n 'resource': {\n 'resourceType': 'EpisodeOfCare',\n 'id': 2,\n 'contained': [\n {\n 'resourceType': 'Condition',\n 'id': '1',\n 'clinicalStatus': 'active',\n 'subject': {\n 'reference': 'http://ehealth.sundhed.dk/patient/fhir/Patient/678072'\n },\n 'assertedDate': '2019-03-11T14:27:16+01:00'\n }\n ],\n 'status': 'planned',\n 'diagnosis': [\n {\n 'condition': {\n 'reference': '#1'\n }\n }\n ],\n 'patient': {\n 'reference': 'Patient/4072'\n },\n 'managingOrganization': {\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71'\n },\n 'period': {\n 'start': '1970-01-01T01:00:01+01:00',\n 'end': '2099-01-01T01:01:40+01:00'\n }\n },\n 'request': {\n 'method': 'POST',\n 'url': 'EpisodeOfCare'\n }\n }\n ]\n}\n</code></pre>\n<h3>Output</h3>\n<pre><code>{\n 'resourceType': 'Bundle',\n 'type': 'transaction',\n 'entry': [\n {\n 'resource': {\n 'resourceType': 'Provenance',\n 'id': '849028939',\n 'target': [\n {\n 'reference': ''\n }\n ],\n 'recorded': '2019-04-11T12:50:24+02:00',\n 'policy': [\n 'http://ehealth.sundhed.dk/policy/ehealth/patient-data',\n 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation'\n ],\n 'agent': [\n {\n 'role': [\n {\n 'coding': [\n {\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\n 'code': 'RESP'\n }\n ]\n }\n ],\n 'whoReference': {\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421'\n }\n }\n ]\n },\n 'response': {\n 'status': '200 OK',\n 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028939'\n }\n },\n {\n 'resource': {\n 'resourceType': 'Provenance',\n 'id': '849028940',\n 'target': [\n {\n 'reference': 'EpisodeOfCare/298359'\n }\n ],\n 'recorded': '2019-04-11T17:50:24+02:00',\n 'reason': [\n {\n 'system': 'http://hl7.org/fhir/v3/ActReason',\n 'code': 'PATADMIN'\n }\n ],\n 'activity': {\n 'system': 'http://hl7.org/fhir/v3/DataOperation',\n 'code': 'CREATE'\n },\n 'agent': [\n {\n 'role': [\n {\n 'coding': [\n {\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\n 'code': 'ENT'\n }\n ]\n }\n ],\n 'whoReference': {\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/4241545'\n }\n }\n ]\n },\n 'response': {\n 'status': '200 OK',\n 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028940'\n }\n },\n {\n 'resource': {\n 'resourceType': 'EpisodeOfCare',\n 'id': '298359',\n 'contained': [\n {\n 'resourceType': 'Condition',\n 'id': '1',\n 'clinicalStatus': 'active',\n 'subject': {\n 'reference': 'http://ehealth.sundhed.dk/patient/fhir/Patient/678072'\n },\n 'assertedDate': '2019-03-11T14:27:16+01:00'\n }\n ],\n 'status': 'planned',\n 'diagnosis': [\n {\n 'condition': {\n 'reference': '#1'\n }\n }\n ],\n 'patient': {\n 'reference': 'Patient/4072'\n },\n 'managingOrganization': {\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71'\n },\n 'period': {\n 'start': '1970-01-01T01:00:01+01:00',\n 'end': '2099-01-01T01:01:40+01:00'\n }\n },\n 'response': {\n 'status': '200 OK',\n 'location': 'http://ehealth.sundhed.dk/episodeofcare/fhir/EpisodeOfCare/78954'\n }\n }\n ]\n}\n</code></pre>\n</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>" }, "url" : "http://ehealth.sundhed.dk/fhir/OperationDefinition/-s-create-episode-of-care", "version" : "2019.5", "name" : "create-episode-of-care", "status" : "active", "kind" : "operation", "date" : "2019-05-08T06:17:13+00:00", "description" : "This operation persists an EpisodeOfCare based on the transient value of an EpisodeOfCare provided in the input.\r\n## Input\r\nThe 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).\r\n### The EpisodeOfCare resource\r\nThe 'id' property of the EpisodeOfCare will be reassigned by the server, but can be referenced by other resources in the same bundle. \r\nThe 'managingOrganization' property of the EpisodeOfCare references the GDPR Data Controller (Danish: 'Dataansvarlig').\r\n### The privacy-Provenance resource\r\nA 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:\r\n- 'http://ehealth.sundhed.dk/policy/ehealth/patient-data' (Danish: Person- og patientdata)\r\n- 'http://ehealth.sundhed.dk/policy/ehealth/supplier-data' (Danish: Leverandørdata)\r\n- 'http://ehealth.sundhed.dk/policy/ehealth/practitioner-data' (Danish: Medarbejderdata)\r\n\nAt 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:\r\n- 'http://ehealth.sundhed.dk/policy/dk/sundhedsloven-0.6.0'\r\n- 'http://ehealth.sundhed.dk/policy/dk/persondataloven-0.6.0'\r\n- 'http://ehealth.sundhed.dk/policy/dk/sikkerhedsbekendtgørelsen-0.6.0'\r\n- 'http://ehealth.sundhed.dk/policy/dk/databeskyttelsesloven-0.6.0'\r\n- 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation-0.6.0'\r\n## Output\r\nFor valid inputs, the server will create, persist and return a new EpisodeOfCare carrying a server-assigned id.\r\n### The origin-Provenance resource\r\nWhenever 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.\r\n## Examples\r\n### Input\r\n```\r\n{\r\n 'resourceType': 'Bundle',\r\n 'type': 'transaction',\r\n 'entry': [\r\n {\r\n 'resource': {\r\n 'resourceType': 'Provenance',\r\n 'id': '1',\r\n 'target': [\r\n {\r\n 'reference': '#2'\r\n }\r\n ],\r\n 'recorded': '2019-04-11T12:50:24+02:00',\r\n 'policy': [\r\n 'http://ehealth.sundhed.dk/policy/ehealth/patient-data',\r\n 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation'\r\n ],\r\n 'agent': [\r\n {\r\n 'role': [\r\n {\r\n 'coding': [\r\n {\r\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\r\n 'code': 'RESP'\r\n }\r\n ]\r\n }\r\n ],\r\n 'whoReference': {\r\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421'\r\n }\r\n }\r\n ]\r\n },\r\n 'request': {\r\n 'method': 'POST',\r\n 'url': 'Provenance'\r\n }\r\n },\r\n {\r\n 'resource': {\r\n 'resourceType': 'EpisodeOfCare',\r\n 'id': 2,\r\n 'contained': [\r\n {\r\n 'resourceType': 'Condition',\r\n 'id': '1',\r\n 'clinicalStatus': 'active',\r\n 'subject': {\r\n 'reference': 'http://ehealth.sundhed.dk/patient/fhir/Patient/678072'\r\n },\r\n 'assertedDate': '2019-03-11T14:27:16+01:00'\r\n }\r\n ],\r\n 'status': 'planned',\r\n 'diagnosis': [\r\n {\r\n 'condition': {\r\n 'reference': '#1'\r\n }\r\n }\r\n ],\r\n 'patient': {\r\n 'reference': 'Patient/4072'\r\n },\r\n 'managingOrganization': {\r\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71'\r\n },\r\n 'period': {\r\n 'start': '1970-01-01T01:00:01+01:00',\r\n 'end': '2099-01-01T01:01:40+01:00'\r\n }\r\n },\r\n 'request': {\r\n 'method': 'POST',\r\n 'url': 'EpisodeOfCare'\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n### Output\r\n```\r\n{\r\n 'resourceType': 'Bundle',\r\n 'type': 'transaction',\r\n 'entry': [\r\n {\r\n 'resource': {\r\n 'resourceType': 'Provenance',\r\n 'id': '849028939',\r\n 'target': [\r\n {\r\n 'reference': ''\r\n }\r\n ],\r\n 'recorded': '2019-04-11T12:50:24+02:00',\r\n 'policy': [\r\n 'http://ehealth.sundhed.dk/policy/ehealth/patient-data',\r\n 'http://ehealth.sundhed.dk/policy/eu/general-data-protection-regulation'\r\n ],\r\n 'agent': [\r\n {\r\n 'role': [\r\n {\r\n 'coding': [\r\n {\r\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\r\n 'code': 'RESP'\r\n }\r\n ]\r\n }\r\n ],\r\n 'whoReference': {\r\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/321421'\r\n }\r\n }\r\n ]\r\n },\r\n 'response': {\r\n 'status': '200 OK',\r\n 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028939'\r\n }\r\n },\r\n {\r\n 'resource': {\r\n 'resourceType': 'Provenance',\r\n 'id': '849028940',\r\n 'target': [\r\n {\r\n 'reference': 'EpisodeOfCare/298359'\r\n }\r\n ],\r\n 'recorded': '2019-04-11T17:50:24+02:00',\r\n 'reason': [\r\n {\r\n 'system': 'http://hl7.org/fhir/v3/ActReason',\r\n 'code': 'PATADMIN'\r\n }\r\n ],\r\n 'activity': {\r\n 'system': 'http://hl7.org/fhir/v3/DataOperation',\r\n 'code': 'CREATE'\r\n },\r\n 'agent': [\r\n {\r\n 'role': [\r\n {\r\n 'coding': [\r\n {\r\n 'system': 'http://hl7.org/fhir/v3/ParticipationType',\r\n 'code': 'ENT'\r\n }\r\n ]\r\n }\r\n ],\r\n 'whoReference': {\r\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Practitioner/4241545'\r\n }\r\n }\r\n ]\r\n },\r\n 'response': {\r\n 'status': '200 OK',\r\n 'location': 'http://ehealth.sundhed.dk/provenance/fhir/Provenance/849028940'\r\n }\r\n },\r\n {\r\n 'resource': {\r\n 'resourceType': 'EpisodeOfCare',\r\n 'id': '298359',\r\n 'contained': [\r\n {\r\n 'resourceType': 'Condition',\r\n 'id': '1',\r\n 'clinicalStatus': 'active',\r\n 'subject': {\r\n 'reference': 'http://ehealth.sundhed.dk/patient/fhir/Patient/678072'\r\n },\r\n 'assertedDate': '2019-03-11T14:27:16+01:00'\r\n }\r\n ],\r\n 'status': 'planned',\r\n 'diagnosis': [\r\n {\r\n 'condition': {\r\n 'reference': '#1'\r\n }\r\n }\r\n ],\r\n 'patient': {\r\n 'reference': 'Patient/4072'\r\n },\r\n 'managingOrganization': {\r\n 'reference': 'http://ehealth.sundhed.dk/organization/fhir/Organization/71'\r\n },\r\n 'period': {\r\n 'start': '1970-01-01T01:00:01+01:00',\r\n 'end': '2099-01-01T01:01:40+01:00'\r\n }\r\n },\r\n 'response': {\r\n 'status': '200 OK',\r\n 'location': 'http://ehealth.sundhed.dk/episodeofcare/fhir/EpisodeOfCare/78954'\r\n }\r\n }\r\n ]\r\n}\r\n```\r\n", "idempotent" : false, "code" : "create-episode-of-care", "system" : true, "type" : false, "instance" : false, "parameter" : [ { "name" : "episodeOfCareAndProvenances", "use" : "in", "min" : 1, "max" : "1", "type" : "Bundle" }, { "name" : "return", "use" : "out", "min" : 0, "max" : "1", "type" : "Bundle" } ] }