eHealth Infrastructure (v2019.5)

StructureDefinition: ehealth-plandefinition - Operation examples

GET [base]/PlanDefinition?name=808bb684-c871-4abf-8047-34e0a80ec207

Header

Accept-Charset: utf-8
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/3.7.0 (FHIR Client; FHIR 3.0.1/DSTU3; apache)
Accept-Encoding: gzip

Response

{
  "resourceType": "Bundle",
  "id": "b6815507-bcac-4f52-84d5-f8ecc7597818",
  "meta": {
    "lastUpdated": "2019-03-11T13:28:00.167+00:00"
  },
  "type": "searchset",
  "total": 2,
  "link": [
    {
      "relation": "self",
      "url": "http://localhost:31000/hapi-fhir-server/fhir/PlanDefinition?_format\u003djson\u0026_pretty\u003dtrue\u0026name\u003d808bb684-c871-4abf-8047-34e0a80ec207"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://localhost:31000/hapi-fhir-server/fhir/PlanDefinition/4337",
      "resource": {
        "resourceType": "PlanDefinition",
        "id": "4337",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-03-11T13:27:59.890+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-plandefinition"
          ]
        },
        "extension": [
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-owner",
            "valueReference": {
              "reference": "Organization/4336"
            }
          },
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-author",
            "valueReference": {
              "reference": "Practitioner/4335"
            }
          }
        ],
        "version": "hest",
        "name": "808bb684-c871-4abf-8047-34e0a80ec207",
        "status": "active"
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "http://localhost:31000/hapi-fhir-server/fhir/PlanDefinition/4331",
      "resource": {
        "resourceType": "PlanDefinition",
        "id": "4331",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-03-11T13:27:59.068+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-plandefinition"
          ]
        },
        "extension": [
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-owner",
            "valueReference": {
              "reference": "Organization/4330"
            }
          },
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-author",
            "valueReference": {
              "reference": "Practitioner/4329"
            }
          }
        ],
        "version": "hest",
        "name": "808bb684-c871-4abf-8047-34e0a80ec207",
        "status": "active"
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

GET [base]/PlanDefinition/4343/_history/2

Header

Accept-Charset: utf-8
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/3.7.0 (FHIR Client; FHIR 3.0.1/DSTU3; apache)
Accept-Encoding: gzip

Response

{
  "resourceType": "PlanDefinition",
  "id": "4343",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2019-03-11T13:28:00.960+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-plandefinition"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-owner",
      "valueReference": {
        "reference": "Organization/4342"
      }
    },
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-author",
      "valueReference": {
        "reference": "Practitioner/4341"
      }
    }
  ],
  "version": "hest",
  "status": "active"
}

POST [base]/PlanDefinition/42/$apply

Header

Accept-Charset: utf-8
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/3.7.0 (FHIR Client; FHIR 3.0.1/DSTU3; apache)
Accept-Encoding: gzip
Content-Type: application/fhir+json; charset=UTF-8

Body:

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "episodeOfCare",
      "resource": {
        "resourceType": "EpisodeOfCare",
        "id": "4328",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-03-11T13:27:58.613+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-episodeofcare"
          ]
        },
        "contained": [
          {
            "resourceType": "Condition",
            "id": "1",
            "clinicalStatus": "active",
            "subject": {
              "reference": "Patient/4327"
            },
            "assertedDate": "2019-03-11T14:27:58+01:00"
          }
        ],
        "status": "active",
        "diagnosis": [
          {
            "condition": {
              "reference": "#1"
            }
          }
        ],
        "patient": {
          "reference": "Patient/4325"
        },
        "managingOrganization": {
          "reference": "Organization/4326"
        },
        "period": {
          "start": "1970-01-01T01:00:01+01:00",
          "end": "1970-01-01T01:01:40+01:00"
        }
      }
    }
  ]
}

Response

{
  "resourceType": "Bundle"
}

PUT [base]/PlanDefinition/4343

Header

Accept-Charset: utf-8
If-Match: "1"
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/3.7.0 (FHIR Client; FHIR 3.0.1/DSTU3; apache)
Accept-Encoding: gzip
Content-Type: application/fhir+json; charset=UTF-8

Body:

{
  "resourceType": "PlanDefinition",
  "id": "4343",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2019-03-11T13:28:00.888+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-plandefinition"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-owner",
      "valueReference": {
        "reference": "Organization/4342"
      }
    },
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-author",
      "valueReference": {
        "reference": "Practitioner/4341"
      }
    }
  ],
  "version": "hest",
  "status": "active"
}

Response

{
  "resourceType": "PlanDefinition",
  "id": "4343",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2019-03-11T13:28:00.960+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-plandefinition"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-owner",
      "valueReference": {
        "reference": "Organization/4342"
      }
    },
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-author",
      "valueReference": {
        "reference": "Practitioner/4341"
      }
    }
  ],
  "version": "hest",
  "status": "active"
}