メインコンテンツまでスキップ
Version: v2.2.0

Document Bundleの分解登録

FHIR仕様に基づき、Document BundleをベースURLにPOSTした際に、分解して個々のリソースを登録する機能です。

内部動作説明

  1. POSTされたDocument BundleからFRUCtoS内部でTransaction Bundleを生成します。

    • Transaction Bundleを内部で生成する際、request要素には同一インスタンスの複数登録を防ぐために、Conditional update(PUTリクエスト)を指定しています。
      例)

      PUT Patient?identifier=http:/example.org/fhir/ids|456456
    • Conditional updateの仕様により、サーバにidentifierが一致するインスタンスがなければcreate、一つだけ存在する場合はupdateとなり、同一インスタンスの複数登録を防いでいます。

    • なお、identifierが一致するインスタンスがサーバに複数存在する場合はエラーとなります。

  2. FRUCtoS内部でtransactionインタラクションを実行します。

注意
  • Bundleの個々のリソースにidentifierがなかった場合はcreateされます。
  • conditional updateの場合、バージョン・更新日が変更されます。
  • サーバー側にDocument Bundleを分解する機能があるのかどうかはCapabilityStatementで判断できません。

リクエスト(Document Bundle)
POST [base] {?_format=[mime-type]}
注意
  • Document Bundleのtypeはdocumentを指定してください。
  • FHIR仕様のConstraintsに従い、Document Bundleの1つ目のエントリは、Compositionリソースを指定してください。
    また、identifier.system、identifier.value、timestampを指定してください。
{
"resourceType": "Bundle",
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0"
},
"type": "document",
"timestamp": "2013-05-28T22:12:21Z",
"entry": [
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Composition/180f219f-97a8-486d-99d9-ed631fe4fc57",
"resource": {
"resourceType": "Composition",
"id": "180f219f-97a8-486d-99d9-ed631fe4fc57",
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "28655-9"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"encounter": {
"reference": "http://fhir.healthintersections.com.au/open/Encounter/doc-example"
},
"date": "2013-02-01T12:30:02Z",
"author": [
{
"reference": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98"
}
],
"title": "Discharge Summary",
"section": [
{
"title": "Reason for admission",
"entry": [
{
"reference": "urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81"
}
]
},
{
"title": "Medications on Discharge",
"entry": [
{
"reference": "urn:uuid:124a6916-5d84-4b8c-b250-10cefb8e6e86"
}
]
}
]
}
},
{
"fullUrl": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98",
"resource": {
"resourceType": "Practitioner",
"identifier": [
{
"system": "http://www.acme.org/practitioners",
"value": "23"
}
],
"name": [
{
"family": "Careful",
"given": [
"Adam"
]
}
]
}
},
{
"fullUrl": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637",
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "http://www.acme.org/patients",
"value": "45"
}
],
"name": [
{
"family": "Everywoman1",
"given": [
"Eve"
]
}
],
"gender": "female",
"birthDate": "1955-01-06"
}
},
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Encounter/doc-example",
"resource": {
"resourceType": "Encounter",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "IMP"
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"period": {
"start": "2013-01-20T12:30:02Z",
"end": "2013-02-01T12:30:02Z"
}
}
},
{
"fullUrl": "urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81",
"resource": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "46241-6"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"encounter": {
"reference": "http://fhir.healthintersections.com.au/open/Encounter/doc-example"
},
"valueString": "Acute Asthmatic attack. Was wheezing for days prior to admission."
}
},
{
"fullUrl": "urn:uuid:124a6916-5d84-4b8c-b250-10cefb8e6e86",
"resource": {
"resourceType": "MedicationRequest",
"status": "unknown",
"intent": "order",
"medicationCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "66493003"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"requester": {
"reference": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98"
},
"dosageInstruction": [
{
"timing": {
"repeat": {
"frequency": 2,
"period": 1,
"periodUnit": "d"
}
},
"route": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "394899003"
}
]
},
"doseAndRate": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/dose-rate-type",
"code": "ordered"
}
]
},
"doseQuantity": {
"value": 1,
"unit": "tablet",
"system": "http://unitsofmeasure.org",
"code": "tbl"
}
}
]
}
]
}
}
]
}
内部的に生成されるTransaction Bundle
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Composition/180f219f-97a8-486d-99d9-ed631fe4fc57",
"resource": {
"resourceType": "Composition",
"id": "180f219f-97a8-486d-99d9-ed631fe4fc57",
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "28655-9"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"encounter": {
"reference": "http://fhir.healthintersections.com.au/open/Encounter/doc-example"
},
"date": "2013-02-01T12:30:02Z",
"author": [
{
"reference": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98"
}
],
"title": "Discharge Summary",
"section": [
{
"title": "Reason for admission",
"entry": [
{
"reference": "urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81"
}
]
},
{
"title": "Medications on Discharge",
"entry": [
{
"reference": "urn:uuid:124a6916-5d84-4b8c-b250-10cefb8e6e86"
}
]
}
]
},
"request": {
"method": "POST",
"url": "Composition"
}
},
{
"fullUrl": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98",
"resource": {
"resourceType": "Practitioner",
"identifier": [
{
"system": "http://www.acme.org/practitioners",
"value": "23"
}
],
"name": [
{
"family": "Careful",
"given": [
"Adam"
]
}
]
},
"request": {
"method": "PUT",
"url": "Practitioner?identifier=http://www.acme.org/practitioners%7C23"
}
},
{
"fullUrl": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637",
"resource": {
"resourceType": "Patient",
"identifier": [
{
"system": "http://www.acme.org/patients",
"value": "45"
}
],
"name": [
{
"family": "Everywoman1",
"given": [
"Eve"
]
}
],
"gender": "female",
"birthDate": "1955-01-06"
},
"request": {
"method": "PUT",
"url": "Patient?identifier=http://www.acme.org/patients%7C45"
}
},
{
"fullUrl": "http://fhir.healthintersections.com.au/open/Encounter/doc-example",
"resource": {
"resourceType": "Encounter",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "IMP"
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"period": {
"start": "2013-01-20T12:30:02Z",
"end": "2013-02-01T12:30:02Z"
}
},
"request": {
"method": "POST",
"url": "Encounter"
}
},
{
"fullUrl": "urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81",
"resource": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "46241-6"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"encounter": {
"reference": "http://fhir.healthintersections.com.au/open/Encounter/doc-example"
},
"valueString": "Acute Asthmatic attack. Was wheezing for days prior to admission."
},
"request": {
"method": "POST",
"url": "Observation"
}
},
{
"fullUrl": "urn:uuid:124a6916-5d84-4b8c-b250-10cefb8e6e86",
"resource": {
"resourceType": "MedicationRequest",
"status": "unknown",
"intent": "order",
"medicationCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "66493003"
}
]
},
"subject": {
"reference": "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637"
},
"requester": {
"reference": "urn:uuid:0cf33a05-d351-ed3d-bd5e-9abb71c01a98"
},
"dosageInstruction": [
{
"timing": {
"repeat": {
"frequency": 2,
"period": 1,
"periodUnit": "d"
}
},
"route": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "394899003"
}
]
},
"doseAndRate": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/dose-rate-type",
"code": "ordered"
}
]
},
"doseQuantity": {
"value": 1,
"unit": "tablet",
"system": "http://unitsofmeasure.org",
"code": "tbl"
}
}
]
}
]
},
"request": {
"method": "POST",
"url": "MedicationRequest"
}
}
]
}
レスポンス

transactionインタラクションと同一のレスポンスが返却されます。

{
"resourceType": "Bundle",
"id": "780c8eb9-2b10-489d-9038-0e676074e094",
"type": "transaction-response",
"entry": [
{
"fullUrl": "http://localhost:8080/fructos/Composition/1",
"resource": {
"resourceType": "Composition",
"id": "1",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.181+09:00"
},
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "28655-9"
}
]
},
"subject": {
"reference": "Patient/6"
},
"encounter": {
"reference": "Encounter/2"
},
"date": "2013-02-01T12:30:02Z",
"author": [
{
"reference": "Practitioner/5"
}
],
"title": "Discharge Summary",
"section": [
{
"title": "Reason for admission",
"entry": [
{
"reference": "Observation/3"
}
]
},
{
"title": "Medications on Discharge",
"entry": [
{
"reference": "MedicationRequest/4"
}
]
}
]
},
"response": {
"status": "201 CREATED",
"location": "Composition/1/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.181+09:00"
}
},
{
"fullUrl": "http://localhost:8080/fructos/Practitioner/5",
"resource": {
"resourceType": "Practitioner",
"id": "5",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.271+09:00"
},
"identifier": [
{
"system": "http://www.acme.org/practitioners",
"value": "23"
}
],
"name": [
{
"family": "Careful",
"given": [
"Adam"
]
}
]
},
"response": {
"status": "201 CREATED",
"location": "Practitioner/5/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.271+09:00"
}
},
{
"fullUrl": "http://localhost:8080/fructos/Patient/6",
"resource": {
"resourceType": "Patient",
"id": "6",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.305+09:00"
},
"identifier": [
{
"system": "http://www.acme.org/patients",
"value": "45"
}
],
"name": [
{
"family": "Everywoman1",
"given": [
"Eve"
]
}
],
"gender": "female",
"birthDate": "1955-01-06"
},
"response": {
"status": "201 CREATED",
"location": "Patient/6/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.305+09:00"
}
},
{
"fullUrl": "http://localhost:8080/fructos/Encounter/2",
"resource": {
"resourceType": "Encounter",
"id": "2",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.197+09:00"
},
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "IMP"
},
"subject": {
"reference": "Patient/6"
},
"period": {
"start": "2013-01-20T12:30:02Z",
"end": "2013-02-01T12:30:02Z"
}
},
"response": {
"status": "201 CREATED",
"location": "Encounter/2/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.197+09:00"
}
},
{
"fullUrl": "http://localhost:8080/fructos/Observation/3",
"resource": {
"resourceType": "Observation",
"id": "3",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.212+09:00"
},
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "46241-6"
}
]
},
"subject": {
"reference": "Patient/6"
},
"encounter": {
"reference": "Encounter/2"
},
"valueString": "Acute Asthmatic attack. Was wheezing for days prior to admission."
},
"response": {
"status": "201 CREATED",
"location": "Observation/3/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.212+09:00"
}
},
{
"fullUrl": "http://localhost:8080/fructos/MedicationRequest/4",
"resource": {
"resourceType": "MedicationRequest",
"id": "4",
"meta": {
"versionId": "1",
"lastUpdated": "2023-11-05T15:45:33.254+09:00"
},
"status": "unknown",
"intent": "order",
"medicationCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "66493003"
}
]
},
"subject": {
"reference": "Patient/6"
},
"requester": {
"reference": "Practitioner/5"
},
"dosageInstruction": [
{
"timing": {
"repeat": {
"frequency": 2,
"period": 1,
"periodUnit": "d"
}
},
"route": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "394899003"
}
]
},
"doseAndRate": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/dose-rate-type",
"code": "ordered"
}
]
},
"doseQuantity": {
"value": 1,
"unit": "tablet",
"system": "http://unitsofmeasure.org",
"code": "tbl"
}
}
]
}
]
},
"response": {
"status": "201 CREATED",
"location": "MedicationRequest/4/_history/1",
"etag": "W/\"1\"",
"lastModified": "2023-11-05T15:45:33.254+09:00"
}
}
]
}