Skip to content

Commit 7f5f0b1

Browse files
author
Adrian Clay
authored
Add two more Absent Attachment scenarios to wiremock (#737)
Scenarios for: - When the content type isn't valid - When the title field is populated To help testing the adaptor within our PTL environment.
1 parent a9290c4 commit 7f5f0b1

3 files changed

Lines changed: 101 additions & 10 deletions

File tree

wiremock/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ curl --request PUT --data '{"state": "Large Patient Record"}' http://localhost:8
8383

8484

8585

86-
To change the patient record returned to be [3 Attachments with 2 Absent](stubs/__files/correctPatientStructuredRecordResponse3AttachmentsWith2Absent.json):
86+
To change the patient record returned to have different Absent Attachment scenarios [Absent Attachments](stubs/__files/correctPatientStructuredRecordResponseAbsentAttachments.json):
8787

8888
```shell
89-
curl --request PUT --data '{"state": "3 Attachments with 2 Absent"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
89+
curl --request PUT --data '{"state": "Absent Attachments"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
9090
```
9191

9292
To change the patient record returned to be NOT FOUND:

wiremock/stubs/__files/correctPatientStructuredRecordResponse3AttachmentsWith2Absent.json renamed to wiremock/stubs/__files/correctPatientStructuredRecordResponseAbsentAttachments.json

Lines changed: 97 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,8 @@
513513
"subject": {
514514
"reference": "Patient/C71B9A8D-26CD-43D9-9030-F6C650879B37"
515515
},
516-
"created": "2020-12-22T14:53:00+00:00",
517-
"indexed": "2020-12-22T14:55:58.567+00:00",
516+
"created": "2020-10-22T14:00:00+00:00",
517+
"indexed": "2020-10-22T14:00:00.000+00:00",
518518
"custodian": {
519519
"reference": "Organization/5E496953-065B-41F2-9577-BE8F2FBD0757"
520520
},
@@ -558,8 +558,8 @@
558558
"subject": {
559559
"reference": "Patient/C71B9A8D-26CD-43D9-9030-F6C650879B37"
560560
},
561-
"created": "2020-12-22T14:54:00+00:00",
562-
"indexed": "2020-12-22T14:56:58.567+00:00",
561+
"created": "2020-11-22T14:00:00+00:00",
562+
"indexed": "2020-11-22T14:00:00.000+00:00",
563563
"custodian": {
564564
"reference": "Organization/5E496953-065B-41F2-9577-BE8F2FBD0757"
565565
},
@@ -602,8 +602,8 @@
602602
"subject": {
603603
"reference": "Patient/C71B9A8D-26CD-43D9-9030-F6C650879B37"
604604
},
605-
"created": "2020-12-22T14:53:00+00:00",
606-
"indexed": "2020-12-22T14:55:58.567+00:00",
605+
"created": "2020-12-22T14:00:00+00:00",
606+
"indexed": "2020-12-22T14:00:00.000+00:00",
607607
"custodian": {
608608
"reference": "Organization/5E496953-065B-41F2-9577-BE8F2FBD0757"
609609
},
@@ -624,6 +624,97 @@
624624
}
625625
}
626626
},
627+
{
628+
"resource": {
629+
"resourceType": "DocumentReference",
630+
"id": "02b40e2d-a445-46f3-b884-1b080d10c255",
631+
"meta": {
632+
"versionId": "8017752596891037527",
633+
"profile": [
634+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1"
635+
]
636+
},
637+
"identifier": [
638+
{
639+
"system": "https://EMISWeb/A82038",
640+
"value": "02b40e2d-a445-46f3-b884-1b080d10c255"
641+
}
642+
],
643+
"status": "current",
644+
"type": {
645+
"text": "(Absent Attachment - Unknown Content Type)"
646+
},
647+
"subject": {
648+
"reference": "Patient/C71B9A8D-26CD-43D9-9030-F6C650879B37"
649+
},
650+
"created": "2021-01-22T14:00:00+00:00",
651+
"indexed": "2021-01-22T14:00:00.000+00:00",
652+
"custodian": {
653+
"reference": "Organization/5E496953-065B-41F2-9577-BE8F2FBD0757"
654+
},
655+
"description": "(Absent Attachment - Unknown Content Type)",
656+
"content": [
657+
{
658+
"attachment": {
659+
"contentType": "text/vbscript",
660+
"url": "{{request.baseUrl}}/B82617/STU3/1/gpconnect/documents/fhir/Binary/43913840-7979-4554-9ab5-55a7a42f1852",
661+
"size": 13
662+
}
663+
}
664+
],
665+
"context": {
666+
"encounter": {
667+
"reference": "Encounter/A44B64EA-172B-4EF5-8809-3FF24F5613C1"
668+
}
669+
}
670+
}
671+
},
672+
{
673+
"resource": {
674+
"resourceType": "DocumentReference",
675+
"id": "dc1bb626-6bbe-4f15-8cd8-44486fb185bf",
676+
"meta": {
677+
"versionId": "8017752596891037527",
678+
"profile": [
679+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DocumentReference-1"
680+
]
681+
},
682+
"identifier": [
683+
{
684+
"system": "https://EMISWeb/A82038",
685+
"value": "dc1bb626-6bbe-4f15-8cd8-44486fb185bf"
686+
}
687+
],
688+
"status": "current",
689+
"type": {
690+
"text": "(Absent Attachment - Title field populated)"
691+
},
692+
"subject": {
693+
"reference": "Patient/C71B9A8D-26CD-43D9-9030-F6C650879B37"
694+
},
695+
"created": "2021-02-22T14:00:00+00:00",
696+
"indexed": "2021-02-22T14:00:00.000+00:00",
697+
"custodian": {
698+
"reference": "Organization/5E496953-065B-41F2-9577-BE8F2FBD0757"
699+
},
700+
"description": "(Absent Attachment - Title field populated)",
701+
"content": [
702+
{
703+
"attachment": {
704+
"contentType": "application/msword",
705+
"title": "Document was recalled by sender for being inflammatory.",
706+
"url": "{{request.baseUrl}}/B82617/STU3/1/gpconnect/documents/fhir/Binary/43913840-7979-4554-9ab5-55a7a42f1852",
707+
"size": 13
708+
}
709+
}
710+
],
711+
"context": {
712+
"encounter": {
713+
"reference": "Encounter/A44B64EA-172B-4EF5-8809-3FF24F5613C1"
714+
}
715+
}
716+
}
717+
},
627718
{
628719
"resource": {
629720
"resourceType": "Organization",

wiremock/stubs/mappings/migrateStructuredRecord_3AttachmentsWith2Absent.json renamed to wiremock/stubs/mappings/migrateStructuredRecord_Absent Attachments.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"priority": 2,
33
"scenarioName": "migrateStructuredRecord",
4-
"requiredScenarioState": "3 Attachments with 2 Absent",
4+
"requiredScenarioState": "Absent Attachments",
55
"request": {
66
"method": "POST",
77
"urlPattern": "/.*/STU3/1/gpconnect/fhir/Patient/[$]gpc[.]migratestructuredrecord"
88
},
99
"response": {
1010
"status": 200,
11-
"bodyFileName": "correctPatientStructuredRecordResponse3AttachmentsWith2Absent.json",
11+
"bodyFileName": "correctPatientStructuredRecordResponseAbsentAttachments.json",
1212
"headers": {
1313
"Server": "nginx",
1414
"Date": "{{now format='E, d MMM y HH:mm:ss z'}}",

0 commit comments

Comments
 (0)