Look at this bundle with an episode of care and how the encounters can reference episodeOfCare. It might help with the design.
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"resource": {
"identifier": [
{
"extension": [
{
"valueReference": {
"reference": "Location/86863db4-6101-4ecf-9a86-5e716d6504e4",
"display": "ART Clinic",
"type": "Location"
},
"url": "http://fhir.openmrs.org/ext/patient/identifier#location"
}
],
"use": "official",
"id": "6d71a17a-55d6-4858-b5ed-a85d081365a7",
"type": {
"coding": [
{
"system": "UgandaEMR",
"code": "05a29f94-c0ed-11e2-94be-8c13b969e334"
}
],
"text": "OpenMRS ID"
},
"value": "10V6E3"
},
{
"use": "usual",
"id": "270d8f89-cc2d-41ca-bc94-e91951ff3801",
"type": {
"coding": [
{
"system": "UgandaEMR",
"code": "f0c16a6d-dc5f-4118-a803-616d0075d282"
}
],
"text": "National ID No."
},
"value": "XXXXXXXXXXXXXX"
},
{
"use": "usual",
"id": "2540b291-1a4b-4651-b049-9d31120a7a03",
"type": {
"coding": [
{
"system": "UgandaEMR",
"code": "8110f2d2-1f98-4c38-aef3-11b19bb0a589"
}
],
"text": "TB No."
},
"value": "68574633"
}
],
"address": [
{
"country": "Uganda",
"extension": [
{
"extension": [
{
"valueString": "MAKINDYE DIVISION",
"url": "http://fhir.openmrs.org/ext/address#subcounty"
},
{
"valueString": "Muyenga",
"url": "http://fhir.openmrs.org/ext/address#parish"
},
{
"valueString": "Bukasa",
"url": "http://fhir.openmrs.org/ext/address#village"
}
],
"url": "http://fhir.openmrs.org/ext/address"
}
],
"use": "home",
"id": "520f8ea6-a5bf-412d-b486-915c49227297",
"state": "KCCA"
}
],
"gender": "male",
"active": true,
"birthDate": "1977-01-01",
"contained": [
{
"agent": [
{
"role": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-ParticipationType",
"code": "AUT",
"display": "author"
}
]
}
],
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemprovenance-participant-type",
"code": "author",
"display": "Author"
}
]
},
"who": {
"reference": "Practitioner/1c3db49d-440a-11e6-a65c-00e04c680037",
"display": "Emerson Kaseem",
"type": "Practitioner"
}
}
],
"activity": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-DataOperation",
"code": "CREATE",
"display": "create"
}
]
},
"id": "1e83abcb-df8b-4b0d-b797-5cca9ba1ed82",
"recorded": "2022-06-07T13:03:22.000+03:00",
"resourceType": "Provenance"
},
{
"agent": [
{
"role": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-ParticipationType",
"code": "AUT",
"display": "author"
}
]
}
],
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemprovenance-participant-type",
"code": "author",
"display": "Author"
}
]
},
"who": {
"reference": "Practitioner/1c3db49d-440a-11e6-a65c-00e04c680037",
"display": "Emerson Kaseem",
"type": "Practitioner"
}
}
],
"activity": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-DataOperation",
"code": "UPDATE",
"display": "revise"
}
]
},
"id": "f1527d6a-da35-4822-aede-5e78e37d2a53",
"recorded": "2022-06-07T14:58:49.000+03:00",
"resourceType": "Provenance"
}
],
"deceasedBoolean": false,
"managingOrganization": {
"reference": "Organization/XXXXXX",
"identifier": {
"system": "https://hmis.health.go.ug/",
"use": "official",
"value": "XXXXXX"
},
"display": "Demo Health Center",
"type": "Organization"
},
"meta": {
"lastUpdated": "2022-06-07T14:58:49.000+03:00"
},
"name": [
{
"given": [
"Tom"
],
"id": "94e0c75b-7b6f-4dac-990c-bc106271439a",
"family": "James"
}
],
"telecom": [
{
"id": "f295c1c0-68d0-4d28-9bcb-8fddffbf1db1",
"value": "0776000000"
}
],
"id": "c350f310-fd89-44de-ad75-bb7827ca1d5b",
"resourceType": "Patient"
},
"request": {
"method": "PUT",
"url": "Patient/c350f310-fd89-44de-ad75-bb7827ca1d5b"
}
},
{
"resource": {
"resourceType": "EpisodeOfCare",
"id": "ee2539ed-2e10-4ba5-a089-8d540b328112",
"identifier": [
{
"use": "usual",
"system": "https://ugandaemr/",
"value": "68574633",
"type": {
"coding": [
{
"system": "UgandaEMR",
"code": "8110f2d2-1f98-4c38-aef3-11b19bb0a589"
}
],
"text": "TB No."
}
}
],
"status": "active",
"type": [
{
"coding": [
{
"code": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"display": "Tuberculosis treatment program"
}
]
}
],
"patient": {
"reference": "Patient/c350f310-fd89-44de-ad75-bb7827ca1d5b",
"type": "Patient",
"display": "Tom James (OpenMRS ID: 10V6E3)"
},
"managingOrganization": {
"reference": "Organization/XXXXX",
"type": "Organization",
"identifier": {
"use": "official",
"system": "https://hmis.health.go.ug/",
"value": "XXXXX"
},
"display": "Demo Health Center"
},
"period": {
"start": "2022-04-01T00:00:00+03:00"
}
},
"request": {
"method": "POST"
}
},
{
"resource": {
"partOf": {
"reference": "Encounter/e50e4c31-08a6-407b-b3cc-417bc92885fe",
"type": "Encounter"
},
"period": {
"start": "2022-04-01T00:00:00+03:00"
},
"subject": {
"reference": "Patient/c350f310-fd89-44de-ad75-bb7827ca1d5b",
"display": "Tom James (OpenMRS ID: 10V6E3)",
"type": "Patient"
},
"type": [
{
"coding": [
{
"system": "http://fhir.openmrs.org/code-system/encounter-type",
"code": "455bad1f-5e97-4ee9-9558-ff1df8808732",
"display": "TB Encounter (Followup)"
}
]
}
],
"participant": [
{
"individual": {
"reference": "Practitioner/2455a599-a800-11e6-9919-80c16ef29100",
"identifier": {
"value": "2455"
},
"display": "Emerson Kaseem (Identifier: 2455)",
"type": "Practitioner"
}
}
],
"contained": [
{
"agent": [
{
"role": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-ParticipationType",
"code": "AUT",
"display": "author"
}
]
}
],
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemprovenance-participant-type",
"code": "author",
"display": "Author"
}
]
},
"who": {
"reference": "Practitioner/1c3db49d-440a-11e6-a65c-00e04c680037",
"display": "Emerson Kaseem",
"type": "Practitioner"
}
}
],
"activity": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-DataOperation",
"code": "CREATE",
"display": "create"
}
]
},
"id": "7dd0288f-5c50-48eb-84c8-a917fb804f1e",
"recorded": "2022-06-07T13:24:22.000+03:00",
"resourceType": "Provenance"
}
],
"meta": {
"tag": [
{
"system": "http://fhir.openmrs.org/ext/encounter-tag",
"code": "encounter",
"display": "Encounter"
}
]
},
"serviceProvider": {
"reference": "Organization/XXXXX",
"identifier": {
"system": "https://hmis.health.go.ug/",
"use": "official",
"value": "XXXXX"
},
"display": "Demo Health Center",
"type": "Organization"
},
"location": [
{
"location": {
"reference": "Location/8ab22b55-9a17-4121-bf08-6134a9a2439f",
"display": "TB Clinic",
"type": "Location"
}
}
],
"id": "41ff8811-23ed-43f9-b302-f90485d915e4",
"episodeOfCare": {
"reference": "EpisodeOfCare/ee2539ed-2e10-4ba5-a089-8d540b328112"
},
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"resourceType": "Encounter",
"status": "unknown"
},
"request": {
"method": "POST"
}
},
{
"resource": {
"partOf": {
"reference": "Encounter/e50e4c31-08a6-407b-b3cc-417bc92885fe",
"type": "Encounter"
},
"contained": [
{
"agent": [
{
"role": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-ParticipationType",
"code": "AUT",
"display": "author"
}
]
}
],
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemprovenance-participant-type",
"code": "author",
"display": "Author"
}
]
},
"who": {
"reference": "Practitioner/1c3db49d-440a-11e6-a65c-00e04c680037",
"display": "Emerson Kaseem",
"type": "Practitioner"
}
}
],
"activity": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-DataOperation",
"code": "CREATE",
"display": "create"
}
]
},
"id": "3ceb5dc3-efca-40b3-b116-f8c0d002a91a",
"recorded": "2022-06-07T13:13:25.000+03:00",
"resourceType": "Provenance"
}
],
"period": {
"start": "2022-04-01T00:00:00+03:00"
},
"meta": {
"tag": [
{
"system": "http://fhir.openmrs.org/ext/encounter-tag",
"code": "encounter",
"display": "Encounter"
}
]
},
"subject": {
"reference": "Patient/c350f310-fd89-44de-ad75-bb7827ca1d5b",
"display": "Tom James (OpenMRS ID: 10V6E3)",
"type": "Patient"
},
"serviceProvider": {
"reference": "Organization/XXXXX",
"identifier": {
"system": "https://hmis.health.go.ug/",
"use": "official",
"value": "XXXXX"
},
"display": "Demo Health Center",
"type": "Organization"
},
"id": "7067e0f7-3309-41b4-8e89-fb3e77a7e537",
"episodeOfCare": {
"reference": "EpisodeOfCare/ee2539ed-2e10-4ba5-a089-8d540b328112"
},
"type": [
{
"coding": [
{
"system": "http://fhir.openmrs.org/code-system/encounter-type",
"code": "334bf97e-28e2-4a27-8727-a5ce31c7cd66",
"display": "TB Summary (Enrollment)"
}
]
}
],
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
},
"resourceType": "Encounter",
"status": "unknown"
},
"request": {
"method": "POST"
}
},
{
"request": {
"method": "POST"
},
"resource": {
"contained": [
{
"agent": [
{
"role": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-ParticipationType",
"code": "AUT",
"display": "author"
}
]
}
],
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemprovenance-participant-type",
"code": "author",
"display": "Author"
}
]
},
"who": {
"reference": "Practitioner/1c3db49d-440a-11e6-a65c-00e04c680037",
"display": "Emerson Kaseem",
"type": "Practitioner"
}
}
],
"activity": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystemv3-DataOperation",
"code": "CREATE",
"display": "create"
}
]
},
"id": "cb6dd69c-3e41-4010-a592-f133879fe1c5",
"recorded": "2022-06-07T13:13:25.000+03:00",
"resourceType": "Provenance"
}
],
"code": {
"coding": [
{
"code": "d2f31713-aada-4d0d-9340-014b2371bdd8",
"display": "Examination Date"
},
{
"system": "UgandaEMR",
"code": "164431",
"display": "Examination Date"
}
]
},
"effectiveDateTime": "2022-04-01T00:00:00+03:00",
"subject": {
"reference": "Patient/c350f310-fd89-44de-ad75-bb7827ca1d5b",
"display": "Tom James (OpenMRS ID: 10V6E3)",
"type": "Patient"
},
"valueDateTime": "2022-04-01T00:00:00+03:00",
"id": "0d68a870-1d7c-4eac-a919-c9c7c0f90672",
"encounter": {
"reference": "Encounter/7067e0f7-3309-41b4-8e89-fb3e77a7e537",
"type": "Encounter"
},
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "exam",
"display": "Exam"
}
]
}
],
"issued": "2022-06-07T13:13:25.000+03:00",
"resourceType": "Observation",
"status": "final"
}
}
]
}
Note this is a demo patient. not real names.