Patient wishes to record Consent. Practitioner records Consent information
+
+#### Workflow
+
+
+A patient presents to be examined by a practitioner. The practitioner performs an examination and determines that a condition and/or an adjustment should be recorded. If the patient does not consent, no details are recorded. If the patient consents, then the condition and/or the adjustment is recorded.
+
+
+
+
+
+
+#### Condition Recorded
+
+
+Pre-condition: Patient details have been retrieved/validated.
+
+
+
+The practioner decides to record a condition. This could be done with individual calls to the required endpoints, or can be done in a single transaction Bundle. A transaction Bundle can help with data integrity requirements and also help to reduce required http calls.
+
+
+
+
+
+
+#### Example 1
+
+> Pre-condition: A patient has previously had a master flag associated with them, and no adjustment is to be recorded
+
+[Single Condition POST](todo.html)
+
+#### Example 2
+
+
+The first example given here shows the use of a transaction to add all required resources to add a Consent, a Condition and associated adjustments (Flag) resources for a patient.
+
+The master Flag and condition Flag (and associated Condition) resources are included and have the Provence resource as contained resources. This example could be modified to include a new condition just by adding the new Condition and Flag resource as this transaction is fully idempotent. The next example will show this.
+
+
+[Example Transaction: Add condition resources in a Transaction](Bundle-add-condition-transaction-example-1.html).
+
+
+NOTE: TODO discuss how provenace could be added after (i.e. not contained), but not in a transaction. If provence needed to be linked to a versioned resource (seems reasonable), this isn't supported https://build.fhir.org/bundle.html#references. Also see https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Provenance.20in.20a.20bundle. Using an etag would work. If the provenance was created after and took the etag of the resource from the response, which should come back for each resource in transaction, the provenance.target could then be set to a versioned url (assuming this was required). Benefits of this would be ability to expand the scope of the provenace. If it really doesn't have a lifetime outside of the resource, contained is probably tidier but definetly less flexible. More discussion here ttps://chat.fhir.org/#narrow/stream/179166-implementers/topic/Transaction.20Bundle.20with.20Provenance/near/402326516.
+
+
+
+The second example given here simply adds conditions to the previous transaction resource to demonstrate the ability to add new conditions to the same data structure and reply in an idempotent way. The request entry in the transaction Bundle for the second condition uses the uuid from the fullUrl on the Bundle entry to use in the URL for the PUT method. The first uses the patient uuid as a search parameter for the PUT. A uuid would be the preferred method to construct the uuid for the fullUrl in the Bundle entry, so this should be a reasonable example. This example is just to demonstrate ReSTful capabilities of the FHIR spec.
+
+
+[Example Transaction: Additional condition and flag added to previous Transaction](Bundle-add-condition-transaction-example-2.html).
+
+
+TODO: maybe cover other ways of doing this, all POST's, if-match, X-provenance, batch tranaction etc...
+
+
+### Relevant Documentation
+
+[Bundles](https://hl7.org/fhir/r4/bundle.html)
+[Transactions](https://hl7.org/fhir/r4/http.html#transaction)
+[Upsert](https://hl7.org/fhir/r4/http.html#upsert)
diff --git a/input/pagecontent/data-model.md b/input/pagecontent/data-model.md
new file mode 100644
index 0000000..c59546e
--- /dev/null
+++ b/input/pagecontent/data-model.md
@@ -0,0 +1,9 @@
+### Summary
+
+The RA record is made up of Consent, Condition, Flag and Provenances resources. The Consent, Condition and Flag resources are linked via a Patient resource. The Provenace resource is only scoped to a sinle Flag and has no lifetime outside of the Flag (specific version) resource.
+
+### Data Model
+
+
+
+
diff --git a/input/pagecontent/server-example-add-ra-record.md b/input/pagecontent/server-example-add-ra-record.md
new file mode 100644
index 0000000..f534f67
--- /dev/null
+++ b/input/pagecontent/server-example-add-ra-record.md
@@ -0,0 +1,45 @@
+### Summary
+
+The [HAPI FHIR Starter Server](https://github.com/hapifhir/hapi-fhir-jpaserver-starter) is used to demostrate some basic REST capabilities in FHIR using examples within this implementation guide.
+
+#### Docker invocation of the HAPI Starter Project
+
+This command starts the server on port 8080 and use UUID (as opposed to sequential numbers) for resource ID's.
+
+```
+docker run -p 8080:8080 -e hapi.fhir.daoconfig_client_id_strategy=UUID -e hapi.fhir.client_id_strategy=ANY hapiproject/hapi:latest
+```
+
+To pull the latest image, run
+
+```
+docker pull hapiproject/hapi:latest
+```
+
+#### Swagger
+
+The HAPI starter project provides an OAS interface to the supported FHIR API. Assuming the above docker command is used, this would be available at
+
+```
+http://localhost:8080/fhir/swagger-ui/index.html
+```
+
+#### CI Build
+
+These examples are loaded into a running FHIR server during the IG build. Some resources (queries) are dynamically generated and added to the IG at build time. (TODO add a list of dynamically generated resources somewhere).
+
+### Examples
+
+The examples here describe the API options related to the workflow given in the use case [Add RA Record](add-ra-record.html#workflow).
+
+#### Example 1
+
+TODO
+
+#### Example 2
+
+The first [example transaction](Bundle-add-condition-transaction-example-1.html) adds an RA record consisting of a Consent resource from the patient, a master Flag resource (is this really needed?), a Condition resource and an associated condition Flag resource using a transaction Bundle, which provides atomicity as well as more network efficent call. Each Flag resource has a Provenance resource embedded in it. (TODO maybe a futher discussion section somewhere on options for provenance, i.e. linking to versions, _history and transaction considerations, options to use etag or X-provenance).
+
+The second [example transaction](Bundle-add-condition-transaction-example-1.html) simply modifies the first transaction by adding additional resources for another Condition and adjustment (Flag). The transactions are using PUT's and as FHIR does defined (upsert)[https://hl7.org/fhir/http.html#upsert] as an option, and the HAPI Starter Server has implemented this, this example has been constructed to demostrate this.
+
+Details of querying the resulting data from these transaction is given in the [Retrieve RA Record](server-example-add-ra-record.html) server example.
\ No newline at end of file
diff --git a/input/pagecontent/server-example-retrieve-ra-record.md b/input/pagecontent/server-example-retrieve-ra-record.md
new file mode 100644
index 0000000..06f6ed2
--- /dev/null
+++ b/input/pagecontent/server-example-retrieve-ra-record.md
@@ -0,0 +1,53 @@
+### Summary
+
+The [HAPI FHIR Starter Server](https://github.com/hapifhir/hapi-fhir-jpaserver-starter) is used to demostrate some basic REST capabilities in FHIR using examples within this implementation guide.
+
+#### Docker invocation of the HAPI Starter Project
+
+This command starts the server on port 8080 and use UUID (as opposed to sequential numbers) for resource ID's.
+
+```
+docker run -p 8080:8080 -e hapi.fhir.daoconfig_client_id_strategy=UUID -e hapi.fhir.client_id_strategy=ANY hapiproject/hapi:latest
+```
+
+To pull the latest image, run
+
+```
+docker pull hapiproject/hapi:latest
+```
+
+#### Swagger
+
+The HAPI starter project provides an OAS interface to the supported FHIR API. Assuming the above docker command is used, this would be available at
+
+```
+http://localhost:8080/fhir/swagger-ui/index.html
+```
+
+#### CI Build
+
+These examples are loaded into a running FHIR server during the IG build. Some resources (queries) are dynamically generated and added to the IG at build time. (TODO add a list of dynamically generated resources somewhere).
+
+### Examples
+
+The examples here describe search options for the workflow given in [Retrieve RA Record](todo.html). This follows on from the data entered in the workflow given in the use case [Add RA Record](add-ra-record.html#workflow).
+
+#### Example 1
+
+Based on the example transaction Bundles given in the use case [Add RA Record](add-ra-record.html#workflow), for each transaction, the following query will performed (dynamically during the IG build)
+
+```
+/Patient?identifier=9912003888&_revinclude=Consent:patient&_revinclude=Flag:patient&_revinclude=Condition:patient
+```
+
+This query will return the Patient resource using the patients NHS number (TODO will be profiled to check for this, reference this later). The assocaited resources that make up the RA are also returned, which are all using default Patient SearchParameters define in the base specification for each resource.
+
+For the [first transaction example](Bundle-add-condition-transaction-example-1.html), this is the [output of the query](Bundle-QUERY-OUTPUT--add-condition-transaction-example-1.html).
+
+For the [second transaction example](Bundle-add-condition-transaction-example-2.html), where a Condition and adjustment (Flag) is added, this is the [output of the query](Bundle-QUERY-OUTPUT--add-condition-transaction-example-2.html).
+
+See the [Data Model](data-model.html) for details on the relationships between the resources.
+
+#### Example #
+
+TODO?
\ No newline at end of file
diff --git a/input/queries/get-flags-associated-with-patient.md b/input/queries/get-flags-associated-with-patient.md
new file mode 100644
index 0000000..43b564b
--- /dev/null
+++ b/input/queries/get-flags-associated-with-patient.md
@@ -0,0 +1 @@
+http://localhost:8080/fhir/Patient?identifier=9912003888&_revinclude=Consent:patient&_revinclude=Flag:patient&_revinclude=Condition:patient
\ No newline at end of file
diff --git a/postman/ReasonableAdjustmentsExamples.postman_collection.json b/postman/ReasonableAdjustmentsExamples.postman_collection.json
new file mode 100644
index 0000000..6f00fb2
--- /dev/null
+++ b/postman/ReasonableAdjustmentsExamples.postman_collection.json
@@ -0,0 +1,82 @@
+{
+ "info": {
+ "_postman_id": "adb3f331-e89f-4548-b96b-b781a41eba64",
+ "name": "ReasonableAdjustmentsExamples",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "32605342"
+ },
+ "item": [
+ {
+ "name": "Add examples",
+ "item": [
+ {
+ "name": "New RA record - Single transaction - Provenance contained",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"resourceType\": \"Bundle\",\n \"id\": \"add-condition-transaction-example-1\",\n \"type\": \"transaction\",\n \"entry\": [\n {\n \"fullUrl\": \"urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\",\n \"resource\": {\n \"resourceType\": \"Patient\",\n \"id\": \"patient-example-1\",\n \"identifier\": [\n {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9912003888\"\n }\n ],\n \"active\": true,\n \"name\": [\n {\n \"use\": \"official\",\n \"family\": \"Duck\",\n \"given\": [\n \"Donald\"\n ]\n }\n ],\n \"gender\": \"male\",\n \"birthDate\": \"1970-01-01\"\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"Patient?identifier=9912003888\"\n }\n },\n {\n \"fullUrl\": \"urn:uuid:959fbc3c-0907-419e-aa3d-ab88f2d90c5e\",\n \"resource\": {\n \"resourceType\": \"Consent\",\n \"id\": \"consent-example-1\",\n \"status\": \"active\",\n \"scope\": {\n \"coding\": [\n {\n \"code\": \"patient-privacy\",\n \"system\": \"http://terminology.hl7.org/CodeSystem/consentscope\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"code\": \"NRAF\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-FlagCategory-1\",\n \"display\": \"National Reasonable Adjustments Flag\"\n }\n ]\n }\n ],\n \"provision\": {\n \"purpose\": [\n {\n \"code\": \"370856009\",\n \"system\": \"https://snomed.info/sct\",\n \"display\": \"Limiting access to confidential patient information\"\n }\n ]\n },\n \"patient\": {\n \"reference\": \"urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n },\n \"policy\": [\n {\n \"authority\": \"https://www.gov.uk/\",\n \"uri\": \"https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/535024/data-security-review.pdf\"\n }\n ]\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"Consent?patient=urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n }\n },\n {\n \"fullUrl\": \"urn:uuid:41a84a93-1c95-4162-b13c-1c617509e6e2\",\n \"resource\": {\n \"resourceType\": \"Condition\",\n \"id\": \"condition-example-1\",\n \"clinicalStatus\": {\n \"coding\": [\n {\n \"code\": \"active\",\n \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"code\": \"issue\",\n \"system\": \"https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-ConditionCategory-1\",\n \"display\": \"Issue\"\n }\n ]\n }\n ],\n \"code\": {\n \"coding\": [\n {\n \"code\": \"5\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-ConditionCode-1\",\n \"display\": \"Learning or understanding or concentrating\"\n }\n ]\n },\n \"subject\": {\n \"reference\": \"urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n }\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"Condition?patient=urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n }\n },\n {\n \"fullUrl\": \"urn:uuid:fba99f70-fe1d-42e2-b77a-916e44b53c19\",\n \"resource\": {\n \"resourceType\": \"Flag\",\n \"id\": \"master-flag-example-1\",\n \"status\": \"active\",\n \"code\": {\n \"coding\": [\n {\n \"code\": \"NRAF\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-FlagCategory-1\",\n \"display\": \"National Reasonable Adjustments Flag\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"code\": \"NRAF\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-FlagCategory-1\",\n \"display\": \"National Reasonable Adjustments Flag\"\n }\n ]\n }\n ],\n \"subject\": {\n \"reference\": \"urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n },\n \"contained\": [\n {\n \"resourceType\": \"Provenance\",\n \"target\": [\n {\n \"reference\": \"#\"\n }\n ],\n \"recorded\": \"2024-01-01T11:00:00+00:00\",\n \"activity\": {\n \"coding\": [\n {\n \"code\": \"CREATE\",\n \"system\": \"http://hl7.org/fhir/v3/DataOperation\",\n \"display\": \"create\"\n }\n ]\n },\n \"agent\": [\n {\n \"role\": [\n {\n \"coding\": [\n {\n \"code\": \"R0260\",\n \"system\": \"https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1\",\n \"display\": \"General Medical Practitioner\"\n }\n ]\n }\n ],\n \"who\": {\n \"reference\": \"https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9\"\n },\n \"onBehalfOf\": {\n \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7\"\n }\n }\n ]\n }\n ]\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"Flag/fba99f70-fe1d-42e2-b77a-916e44b53c19\"\n }\n },\n {\n \"fullUrl\": \"urn:uuid:04adcb5b-3de7-4f67-97f0-b2fdf941ba85\",\n \"resource\": {\n \"resourceType\": \"Flag\",\n \"id\": \"condition-flag-example-1\",\n \"status\": \"active\",\n \"code\": {\n \"coding\": [\n {\n \"code\": \"001\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-AdjustmentCategory-1\",\n \"display\": \"Communication support\"\n }\n ]\n },\n \"category\": [\n {\n \"coding\": [\n {\n \"code\": \"NRAF\",\n \"system\": \"https://fhir.nhs.uk/STU3/CodeSystem/RARecord-FlagCategory-1\",\n \"display\": \"National Reasonable Adjustments Flag\"\n }\n ]\n }\n ],\n \"subject\": {\n \"reference\": \"urn:uuid:6253c43b-5cc8-4645-93b1-38e41be82a77\"\n },\n \"contained\": [\n {\n \"resourceType\": \"Provenance\",\n \"target\": [\n {\n \"reference\": \"#\"\n }\n ],\n \"recorded\": \"2024-01-01T11:00:00+00:00\",\n \"activity\": {\n \"coding\": [\n {\n \"code\": \"CREATE\",\n \"system\": \"http://hl7.org/fhir/v3/DataOperation\",\n \"display\": \"create\"\n }\n ]\n },\n \"agent\": [\n {\n \"role\": [\n {\n \"coding\": [\n {\n \"code\": \"R0260\",\n \"system\": \"https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1\",\n \"display\": \"General Medical Practitioner\"\n }\n ]\n }\n ],\n \"who\": {\n \"reference\": \"https://sds.spineservices.nhs.uk/STU3/Practitioner/2ee4tr6a9\"\n },\n \"onBehalfOf\": {\n \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/a3e5i7\"\n }\n }\n ]\n }\n ]\n },\n \"request\": {\n \"method\": \"PUT\",\n \"url\": \"Flag/04adcb5b-3de7-4f67-97f0-b2fdf941ba85\"\n }\n }\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://localhost:8080/fhir",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8080",
+ "path": [
+ "fhir"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "Query examples",
+ "item": [
+ {
+ "name": "Get Flags associated with Patient",
+ "request": {
+ "method": "GET",
+ "header": [],
+ "url": {
+ "raw": "http://localhost:8080/fhir/Patient?identifier=9912003888&_revinclude=Consent:patient&_revinclude=Flag:patient",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "8080",
+ "path": [
+ "fhir",
+ "Patient"
+ ],
+ "query": [
+ {
+ "key": "identifier",
+ "value": "9912003888"
+ },
+ {
+ "key": "_revinclude",
+ "value": "Consent:patient"
+ },
+ {
+ "key": "_revinclude",
+ "value": "Flag:patient"
+ }
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/sushi-config.yaml b/sushi-config.yaml
index 558d5b1..ead1e9f 100644
--- a/sushi-config.yaml
+++ b/sushi-config.yaml
@@ -77,13 +77,15 @@ publisher:
menu:
Home: index.html
Sitemap: toc.html
+ Data Model: data-model.html
Use Cases:
- Add Condition(s): add-condition.html
- Add Adjustment(s): todo.html
- Retrieve Condition(s): retrieve-condition.html
- Retrieve Adjustment(s): todo.html
- Remove Condition(s): todo.html
- Remove Adjustment(s): todo.html
+ Add RA Record: add-ra-record.html
+ Retrieve RA Record: todo.html
+ Remove RA Record: todo.html
+ Server Examples:
+ Add RA Record: server-example-add-ra-record.html
+ Retrieve RA Record: server-example-retrieve-ra-record.html
+ Remove RA Record: todo.html
Artifacts: artifacts.html
Contact Us: todo.html
Downloads: todo.html