eHealth Infrastructure (v2020.7)

StructureDefinition: ehealth-deviceusestatement - Operation examples

GET [base]/DeviceUseStatement?patient=https%3A%2F%2Fpatient.cit-device-529.local%2Ffhir%2FPatient%2F91440&when-used=lt2020-03-22

Header

Accept-Charset: utf-8
Authorization: Bearer eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoiNjIwOWFjOTktNTliMi00YjVhLTllMTQtNGU2ZWQxZjY2Y2VjIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIkRldmljZVVzZVN0YXRlbWVudC5yZWFkIl19LCJ1c2VyX3R5cGUiOiJTWVNURU0ifQ.
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/5.0.2 (FHIR Client; FHIR 3.0.2/DSTU3; apache)
Accept-Encoding: gzip

Response

{
  "resourceType": "Bundle",
  "id": "6b876ea8-bcba-4dc3-a4e0-a51abd29887f",
  "meta": {
    "lastUpdated": "2020-10-22T13:54:41.850+00:00"
  },
  "type": "searchset",
  "total": 2,
  "link": [
    {
      "relation": "self",
      "url": "https://device.cit-device-529.local/fhir/DeviceUseStatement?_format=json&_pretty=true&patient=https%3A%2F%2Fpatient.cit-device-529.local%2Ffhir%2FPatient%2F91440&when-used=lt2020-03-22"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://device.cit-device-529.local/fhir/DeviceUseStatement/56",
      "resource": {
        "resourceType": "DeviceUseStatement",
        "id": "56",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2020-10-22T13:54:41.349+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
          ]
        },
        "extension": [
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
            "valueReference": {
              "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/12871"
            }
          }
        ],
        "status": "active",
        "subject": {
          "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
        },
        "whenUsed": {
          "start": "2020-02-22T13:54:40+00:00",
          "end": "2020-04-22T13:54:40+00:00"
        },
        "device": {
          "reference": "https://device.cit-device-529.local/fhir/Device/55"
        }
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "https://device.cit-device-529.local/fhir/DeviceUseStatement/54",
      "resource": {
        "resourceType": "DeviceUseStatement",
        "id": "54",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2020-10-22T13:54:41.073+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
          ]
        },
        "extension": [
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
            "valueReference": {
              "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/451"
            }
          }
        ],
        "status": "active",
        "subject": {
          "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
        },
        "whenUsed": {
          "start": "2019-10-22T13:54:40+00:00",
          "end": "2019-12-22T13:54:40+00:00"
        },
        "device": {
          "reference": "https://device.cit-device-529.local/fhir/Device/53"
        }
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

GET [base]/DeviceUseStatement/64/_history/2

Header

Accept-Charset: utf-8
Authorization: Bearer eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoiYTkzNmVhMGItMDE0My00MzM1LWJhYmItNTM5Mzk0ODJiYjIwIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIkRldmljZVVzZVN0YXRlbWVudC5yZWFkIiwiRGV2aWNlVXNlU3RhdGVtZW50LndyaXRlIl19LCJjb250ZXh0Ijp7InBhdGllbnRfaWQiOiJodHRwczovL3BhdGllbnQuY2l0LWRldmljZS01MjkubG9jYWwvZmhpci9QYXRpZW50LzkxNDQwIiwidGVhbV9vbl9lb2MiOmZhbHNlfSwidXNlcl90eXBlIjoiU1lTVEVNIn0.
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/5.0.2 (FHIR Client; FHIR 3.0.2/DSTU3; apache)
Accept-Encoding: gzip

Response

{
  "resourceType": "DeviceUseStatement",
  "id": "64",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2020-10-22T13:54:43.323+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
      "valueReference": {
        "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/11749"
      }
    }
  ],
  "status": "completed",
  "subject": {
    "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
  },
  "device": {
    "reference": "https://device.cit-device-529.local/fhir/Device/63"
  }
}

POST [base]/DeviceUseStatement

Header

Accept-Charset: utf-8
Authorization: Bearer eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoiYTE4YTE3NjUtMDc2OS00NDVkLTgzY2ItZDVlNjUwM2FiMjViIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIkRldmljZVVzZVN0YXRlbWVudC53cml0ZSJdfSwiY29udGV4dCI6eyJwYXRpZW50X2lkIjoiaHR0cHM6Ly9wYXRpZW50LmNpdC1kZXZpY2UtNTI5LmxvY2FsL2ZoaXIvUGF0aWVudC80ODUiLCJ0ZWFtX29uX2VvYyI6ZmFsc2V9LCJ1c2VyX3R5cGUiOiJTWVNURU0ifQ.
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/5.0.2 (FHIR Client; FHIR 3.0.2/DSTU3; apache)
Accept-Encoding: gzip
Content-Type: application/fhir+json; charset=UTF-8

Body:

{
  "resourceType": "DeviceUseStatement",
  "meta": {
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
      "valueReference": {
        "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/59083"
      }
    }
  ],
  "status": "active",
  "subject": {
    "reference": "https://patient.cit-device-529.local/fhir/Patient/485"
  },
  "device": {
    "reference": "https://device.cit-device-529.local/fhir/Device/78"
  }
}

Response

{
  "resourceType": "DeviceUseStatement",
  "id": "80",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2020-10-22T13:54:48.128+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
      "valueReference": {
        "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/59083"
      }
    }
  ],
  "status": "active",
  "subject": {
    "reference": "https://patient.cit-device-529.local/fhir/Patient/485"
  },
  "device": {
    "reference": "https://device.cit-device-529.local/fhir/Device/78"
  }
}

POST [base]/DeviceUseStatement/$validate

Header

Accept-Charset: utf-8
Authorization: Bearer eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoiMDYwNzQyZTItZWMwMy00ZGQxLTlmYWYtNDdhOGMxNmNkMGU0IiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIkRldmljZVVzZVN0YXRlbWVudC5yZWFkIl19LCJ1c2VyX3R5cGUiOiJTWVNURU0ifQ.
Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
User-Agent: HAPI-FHIR/5.0.2 (FHIR Client; FHIR 3.0.2/DSTU3; apache)
Accept-Encoding: gzip
Content-Type: application/fhir+json; charset=UTF-8

Body:

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "resource",
      "resource": {
        "resourceType": "DeviceUseStatement",
        "meta": {
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
          ]
        },
        "extension": [
          {
            "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
            "valueReference": {
              "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/56742"
            }
          }
        ],
        "status": "active",
        "subject": {
          "reference": "https://patient.cit-device-529.local/fhir/Patient/12072"
        },
        "source": {
          "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
        },
        "device": {
          "reference": "https://device.cit-device-529.local/fhir/Device/70"
        }
      }
    }
  ]
}

Response

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">INFORMATION</td><td>[]</td><td><pre>No issues detected during validation</pre></td></tr><tr><td style=\"font-weight: bold;\">INFORMATION</td><td>[]</td><td><pre>No issues detected during validation</pre></td></tr></table></div>"
  },
  "issue": [
    {
      "severity": "information",
      "code": "informational",
      "diagnostics": "No issues detected during validation"
    },
    {
      "severity": "information",
      "code": "informational",
      "diagnostics": "No issues detected during validation"
    }
  ]
}

PUT [base]/DeviceUseStatement/64

Header

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

Body:

{
  "resourceType": "DeviceUseStatement",
  "id": "64",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2020-10-22T13:54:43.148+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
      "valueReference": {
        "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/11749"
      }
    }
  ],
  "status": "completed",
  "subject": {
    "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
  },
  "device": {
    "reference": "https://device.cit-device-529.local/fhir/Device/63"
  }
}

Response

{
  "resourceType": "DeviceUseStatement",
  "id": "64",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2020-10-22T13:54:43.323+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement"
    ]
  },
  "extension": [
    {
      "url": "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-deviceusestatement-context",
      "valueReference": {
        "reference": "https://careplan.cit-device-529.local/fhir/CarePlan/11749"
      }
    }
  ],
  "status": "completed",
  "subject": {
    "reference": "https://patient.cit-device-529.local/fhir/Patient/91440"
  },
  "device": {
    "reference": "https://device.cit-device-529.local/fhir/Device/63"
  }
}