File tree Expand file tree Collapse file tree 6 files changed +62
-0
lines changed
Expand file tree Collapse file tree 6 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,10 @@ export const POINTER_TYPES = [
2525 "824321000000109" ,
2626 "2181441000000107" ,
2727] ;
28+ export const CATEGORIES = [
29+ "734163000" ,
30+ "1102421000000108" ,
31+ "823651000000106" ,
32+ "721981007" ,
33+ "103693007" ,
34+ ] ;
Original file line number Diff line number Diff line change @@ -41,6 +41,17 @@ export const options = {
4141 { target : 5 , duration : "1m" } ,
4242 ] ,
4343 } ,
44+ searchDocumentReferenceByCategory : {
45+ exec : "searchDocumentReferenceByCategory" ,
46+ executor : "ramping-arrival-rate" ,
47+ startRate : 1 ,
48+ timeUnit : "1s" ,
49+ preAllocatedVUs : 5 ,
50+ stages : [
51+ { target : 5 , duration : "30s" } ,
52+ { target : 5 , duration : "1m" } ,
53+ ] ,
54+ } ,
4455 searchPostDocumentReference : {
4556 exec : "searchPostDocumentReference" ,
4657 executor : "ramping-arrival-rate" ,
Original file line number Diff line number Diff line change @@ -82,6 +82,27 @@ export function searchDocumentReference() {
8282 checkResponse ( res ) ;
8383}
8484
85+ export function searchDocumentReferenceByCategory ( ) {
86+ const nhsNumber = NHS_NUMBERS [ Math . floor ( Math . random ( ) * NHS_NUMBERS . length ) ] ;
87+ const randomCategory =
88+ CATEGORIES [ Math . floor ( Math . random ( ) * CATEGORIES . length ) ] ;
89+
90+ const identifier = encodeURIComponent (
91+ `https://fhir.nhs.uk/Id/nhs-number|${ nhsNumber } `
92+ ) ;
93+ const category = encodeURIComponent (
94+ `http://snomed.info/sct|${ randomCategory } `
95+ ) ;
96+
97+ const res = http . get (
98+ `https://${ __ENV . HOST } /consumer/DocumentReference?subject:identifier=${ identifier } &category=${ category } ` ,
99+ {
100+ headers : getHeaders ( ) ,
101+ }
102+ ) ;
103+ checkResponse ( res ) ;
104+ }
105+
85106export function searchPostDocumentReference ( ) {
86107 const nhsNumber = NHS_NUMBERS [ Math . floor ( Math . random ( ) * NHS_NUMBERS . length ) ] ;
87108 const pointer_type =
Original file line number Diff line number Diff line change @@ -44,6 +44,17 @@ export const options = {
4444 { target : 0 , duration : "1m" } ,
4545 ] ,
4646 } ,
47+ searchDocumentReferenceByCategory : {
48+ exec : "searchDocumentReferenceByCategory" ,
49+ executor : "ramping-arrival-rate" ,
50+ startRate : 1 ,
51+ timeUnit : "1s" ,
52+ preAllocatedVUs : 5 ,
53+ stages : [
54+ { target : 5 , duration : "30s" } ,
55+ { target : 5 , duration : "1m" } ,
56+ ] ,
57+ } ,
4758 searchPostDocumentReference : {
4859 exec : "searchPostDocumentReference" ,
4960 executor : "ramping-arrival-rate" ,
Original file line number Diff line number Diff line change @@ -35,6 +35,17 @@ export const options = {
3535 { target : 10 , duration : "1m" } ,
3636 ] ,
3737 } ,
38+ searchDocumentReferenceByCategory : {
39+ exec : "searchDocumentReferenceByCategory" ,
40+ executor : "ramping-arrival-rate" ,
41+ startRate : 1 ,
42+ timeUnit : "1s" ,
43+ preAllocatedVUs : 5 ,
44+ stages : [
45+ { target : 5 , duration : "30s" } ,
46+ { target : 5 , duration : "1m" } ,
47+ ] ,
48+ } ,
3849 searchPostDocumentReference : {
3950 exec : "searchPostDocumentReference" ,
4051 executor : "ramping-vus" ,
Original file line number Diff line number Diff line change 66 POINTER_IDS ,
77 POINTER_DOCUMENTS ,
88 POINTERS_TO_DELETE ,
9+ CATEGORIES ,
910} from "../constants.js" ;
1011import { check } from "k6" ;
1112import { randomItem } from "https://jslib.k6.io/k6-utils/1.2.0/index.js" ;
You can’t perform that action at this time.
0 commit comments