eHealth Infrastructure (v2019.5)

StructureDefinition: ehealth-consent - Operation examples

GET [base]/Consent?patient=Patient%2F3945

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": "2ff3e73d-f7c7-4b76-b807-16bbb19124e1",
  "meta": {
    "lastUpdated": "2019-03-11T13:26:56.309+00:00"
  },
  "type": "searchset",
  "total": 2,
  "link": [
    {
      "relation": "self",
      "url": "http://localhost:31000/hapi-fhir-server/fhir/Consent?_format\u003djson\u0026_pretty\u003dtrue\u0026patient\u003dPatient%2F3945"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://localhost:31000/hapi-fhir-server/fhir/Consent/3966",
      "resource": {
        "resourceType": "Consent",
        "id": "3966",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-03-11T13:26:53.327+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
          ]
        },
        "status": "active",
        "category": [
          {
            "id": "2215262b-a514-4138-97dd-b3338a56aff3",
            "coding": [
              {
                "code": "ad686dc1-8928-481f-acbd-1ace73a683de"
              }
            ],
            "text": "code"
          }
        ],
        "patient": {
          "reference": "Patient/3945"
        },
        "period": {
          "start": "1970-01-01T01:00:01+01:00",
          "end": "1970-01-01T01:01:40+01:00"
        },
        "consentingParty": [
          {
            "reference": "Patient/3959"
          }
        ],
        "actor": [
          {
            "id": "95202333-a088-4277-a03e-34eb636f7106",
            "role": {
              "text": "code"
            },
            "reference": {
              "reference": "Patient/3960"
            }
          }
        ],
        "policyRule": "Rule",
        "data": [
          {
            "meaning": "related",
            "reference": {
              "reference": "EpisodeOfCare/3965"
            }
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    },
    {
      "fullUrl": "http://localhost:31000/hapi-fhir-server/fhir/Consent/3950",
      "resource": {
        "resourceType": "Consent",
        "id": "3950",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-03-11T13:26:48.306+00:00",
          "profile": [
            "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
          ]
        },
        "status": "active",
        "category": [
          {
            "id": "632dc3eb-3e5f-40b4-9604-5a75382c50d8",
            "coding": [
              {
                "code": "a024aec3-ceb6-4b13-862b-39a919d4493b"
              }
            ],
            "text": "code"
          }
        ],
        "patient": {
          "reference": "Patient/3945"
        },
        "period": {
          "start": "1970-01-01T01:00:01+01:00",
          "end": "1970-01-01T01:01:40+01:00"
        },
        "consentingParty": [
          {
            "reference": "Patient/3943"
          }
        ],
        "actor": [
          {
            "id": "0325d095-ddd3-43f4-b5a9-d88f1b29caf9",
            "role": {
              "text": "code"
            },
            "reference": {
              "reference": "Patient/3944"
            }
          }
        ],
        "policyRule": "Rule",
        "data": [
          {
            "meaning": "related",
            "reference": {
              "reference": "EpisodeOfCare/3949"
            }
          }
        ]
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}

GET [base]/Consent/3982/_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": "Consent",
  "id": "3982",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2019-03-11T13:26:59.474+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
    ]
  },
  "status": "draft",
  "category": [
    {
      "id": "da0ed773-a757-452b-ba7f-d9b4c758f376",
      "coding": [
        {
          "code": "499dc374-2211-49fd-bb64-41c831e98fa5"
        }
      ],
      "text": "code"
    }
  ],
  "patient": {
    "reference": "Patient/3977"
  },
  "period": {
    "start": "1970-01-01T01:00:01+01:00",
    "end": "1970-01-01T01:01:40+01:00"
  },
  "consentingParty": [
    {
      "reference": "Patient/3975"
    }
  ],
  "actor": [
    {
      "id": "800363c4-c408-4268-bc09-e2873dd6786a",
      "role": {
        "text": "code"
      },
      "reference": {
        "reference": "Patient/3976"
      }
    }
  ],
  "policyRule": "Rule",
  "data": [
    {
      "meaning": "related",
      "reference": {
        "reference": "EpisodeOfCare/3981"
      }
    }
  ]
}

POST [base]/Consent

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": "Consent",
  "meta": {
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
    ]
  },
  "status": "active",
  "category": [
    {
      "id": "446cf31e-9359-4de5-85dc-9a0d7d6ebdeb",
      "coding": [
        {
          "code": "8ae2b44c-2d4e-4779-a669-db2a80cdbf04"
        }
      ],
      "text": "code"
    }
  ],
  "patient": {
    "reference": "Patient/3929"
  },
  "period": {
    "start": "1970-01-01T01:00:01+01:00",
    "end": "1970-01-01T01:01:40+01:00"
  },
  "consentingParty": [
    {
      "reference": "Patient/3927"
    }
  ],
  "actor": [
    {
      "id": "379b5fcf-d4ff-4377-ba6c-13f58446ef10",
      "role": {
        "text": "code"
      },
      "reference": {
        "reference": "Patient/3928"
      }
    }
  ],
  "policyRule": "Rule",
  "data": [
    {
      "meaning": "related",
      "reference": {
        "reference": "EpisodeOfCare/3933"
      }
    }
  ]
}

Response

{
  "resourceType": "Consent",
  "id": "3934",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2019-03-11T13:26:45.407+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
    ]
  },
  "status": "active",
  "category": [
    {
      "id": "446cf31e-9359-4de5-85dc-9a0d7d6ebdeb",
      "coding": [
        {
          "code": "8ae2b44c-2d4e-4779-a669-db2a80cdbf04"
        }
      ],
      "text": "code"
    }
  ],
  "patient": {
    "reference": "Patient/3929"
  },
  "period": {
    "start": "1970-01-01T01:00:01+01:00",
    "end": "1970-01-01T01:01:40+01:00"
  },
  "consentingParty": [
    {
      "reference": "Patient/3927"
    }
  ],
  "actor": [
    {
      "id": "379b5fcf-d4ff-4377-ba6c-13f58446ef10",
      "role": {
        "text": "code"
      },
      "reference": {
        "reference": "Patient/3928"
      }
    }
  ],
  "policyRule": "Rule",
  "data": [
    {
      "meaning": "related",
      "reference": {
        "reference": "EpisodeOfCare/3933"
      }
    }
  ]
}

PUT [base]/Consent/3982

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": "Consent",
  "id": "3982",
  "meta": {
    "versionId": "1",
    "lastUpdated": "2019-03-11T13:26:59.250+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
    ]
  },
  "status": "draft",
  "category": [
    {
      "id": "da0ed773-a757-452b-ba7f-d9b4c758f376",
      "coding": [
        {
          "code": "499dc374-2211-49fd-bb64-41c831e98fa5"
        }
      ],
      "text": "code"
    }
  ],
  "patient": {
    "reference": "Patient/3977"
  },
  "period": {
    "start": "1970-01-01T01:00:01+01:00",
    "end": "1970-01-01T01:01:40+01:00"
  },
  "consentingParty": [
    {
      "reference": "Patient/3975"
    }
  ],
  "actor": [
    {
      "id": "800363c4-c408-4268-bc09-e2873dd6786a",
      "role": {
        "text": "code"
      },
      "reference": {
        "reference": "Patient/3976"
      }
    }
  ],
  "policyRule": "Rule",
  "data": [
    {
      "meaning": "related",
      "reference": {
        "reference": "EpisodeOfCare/3981"
      }
    }
  ]
}

Response

{
  "resourceType": "Consent",
  "id": "3982",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2019-03-11T13:26:59.474+00:00",
    "profile": [
      "http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-consent"
    ]
  },
  "status": "draft",
  "category": [
    {
      "id": "da0ed773-a757-452b-ba7f-d9b4c758f376",
      "coding": [
        {
          "code": "499dc374-2211-49fd-bb64-41c831e98fa5"
        }
      ],
      "text": "code"
    }
  ],
  "patient": {
    "reference": "Patient/3977"
  },
  "period": {
    "start": "1970-01-01T01:00:01+01:00",
    "end": "1970-01-01T01:01:40+01:00"
  },
  "consentingParty": [
    {
      "reference": "Patient/3975"
    }
  ],
  "actor": [
    {
      "id": "800363c4-c408-4268-bc09-e2873dd6786a",
      "role": {
        "text": "code"
      },
      "reference": {
        "reference": "Patient/3976"
      }
    }
  ],
  "policyRule": "Rule",
  "data": [
    {
      "meaning": "related",
      "reference": {
        "reference": "EpisodeOfCare/3981"
      }
    }
  ]
}