@@ -202,11 +202,11 @@ def test_get_immunization_by_id(self):
202202 self .imms_repo .get_immunization_by_id .return_value = {"Resource" : create_covid_19_immunization (imms_id ).dict ()}
203203
204204 # When
205- service_resp = self .fhir_service .get_immunization_by_id (imms_id , "COVID19:read " )
205+ service_resp = self .fhir_service .get_immunization_by_id (imms_id , "COVID19.CRUDS " )
206206 act_imms = service_resp ["Resource" ]
207207
208208 # Then
209- self .imms_repo .get_immunization_by_id .assert_called_once_with (imms_id , "COVID19:read " )
209+ self .imms_repo .get_immunization_by_id .assert_called_once_with (imms_id , "COVID19.CRUDS " )
210210
211211 self .assertEqual (act_imms .id , imms_id )
212212
@@ -216,11 +216,11 @@ def test_immunization_not_found(self):
216216 self .imms_repo .get_immunization_by_id .return_value = None
217217
218218 # When
219- act_imms = self .fhir_service .get_immunization_by_id (imms_id , "COVID19:read " )
219+ act_imms = self .fhir_service .get_immunization_by_id (imms_id , "COVID19.CRUDS " )
220220
221221 # Then
222222 self .imms_repo .get_immunization_by_id .assert_called_once_with (
223- imms_id , "COVID19:read "
223+ imms_id , "COVID19.CRUDS "
224224 )
225225 self .assertEqual (act_imms , None )
226226
@@ -238,7 +238,7 @@ def test_get_immunization_by_id_patient_not_restricted(self):
238238 expected_output = Immunization .parse_obj (expected_imms )
239239
240240 # When
241- actual_output = self .fhir_service .get_immunization_by_id (imms_id , "COVID19:read " )
241+ actual_output = self .fhir_service .get_immunization_by_id (imms_id , "COV.CRUDS " )
242242
243243 # Then
244244 self .assertEqual (actual_output ["Resource" ], expected_output )
@@ -342,10 +342,10 @@ def test_immunization_not_found(self):
342342 self .imms_repo .get_immunization_by_identifier .return_value = {}
343343
344344 # When
345- act_imms = self .fhir_service .get_immunization_by_identifier (imms_id , "COVID19:search " , identifier , element )
345+ act_imms = self .fhir_service .get_immunization_by_identifier (imms_id , "COVID19.CRUDS " , identifier , element )
346346
347347 # Then
348- self .imms_repo .get_immunization_by_identifier .assert_called_once_with (imms_id , "COVID19:search " )
348+ self .imms_repo .get_immunization_by_identifier .assert_called_once_with (imms_id , "COVID19.CRUDS " )
349349
350350 self .assertEqual (act_imms ["entry" ], [])
351351
@@ -374,10 +374,10 @@ def test_create_immunization(self):
374374 req_imms = create_covid_19_immunization_dict_no_id (nhs_number )
375375 req_patient = get_contained_patient (req_imms )
376376 # When
377- stored_imms = self .fhir_service .create_immunization (req_imms , ["COVID19:create " ], "Test" )
377+ stored_imms = self .fhir_service .create_immunization (req_imms , ["COVID19.CRUDS " ], "Test" )
378378
379379 # Then
380- self .imms_repo .create_immunization .assert_called_once_with (req_imms , req_patient , ["COVID19:create " ], "Test" )
380+ self .imms_repo .create_immunization .assert_called_once_with (req_imms , req_patient , ["COVID19.CRUDS " ], "Test" )
381381
382382 self .validator .validate .assert_called_once_with (req_imms )
383383 self .assertIsInstance (stored_imms , Immunization )
@@ -389,7 +389,7 @@ def test_create_immunization_with_id(self):
389389
390390 with self .assertRaises (CustomValidationError ) as error :
391391 # When
392- self .pre_validate_fhir_service .create_immunization (imms , "COVID19:create " , "Test" )
392+ self .pre_validate_fhir_service .create_immunization (imms , "COVID19.CRUDS " , "Test" )
393393
394394 # Then
395395 self .assertTrue (expected_msg in error .exception .message )
@@ -403,7 +403,7 @@ def test_pre_validation_failed(self):
403403
404404 with self .assertRaises (CustomValidationError ) as error :
405405 # When
406- self .pre_validate_fhir_service .create_immunization (imms , ["COVID19:create " ], "Test" )
406+ self .pre_validate_fhir_service .create_immunization (imms , ["COVID19.CRUDS " ], "Test" )
407407
408408 # Then
409409 self .assertTrue (expected_msg in error .exception .message )
@@ -424,7 +424,7 @@ def test_post_validation_failed_create_invalid_target_disease(self):
424424 fhir_service = FhirService (self .imms_repo )
425425
426426 with self .assertRaises (CustomValidationError ) as error :
427- fhir_service .create_immunization (bad_target_disease_imms , "COVID19:create " , "Test" )
427+ fhir_service .create_immunization (bad_target_disease_imms , "COVID19.CRUDS " , "Test" )
428428
429429 self .assertEqual (bad_target_disease_msg , error .exception .message )
430430 self .imms_repo .create_immunization .assert_not_called ()
@@ -443,7 +443,7 @@ def test_post_validation_failed_create_missing_patient_name(self):
443443 fhir_service = FhirService (self .imms_repo )
444444
445445 with self .assertRaises (CustomValidationError ) as error :
446- fhir_service .create_immunization (bad_patient_name_imms , "COVID19:create " , "Test" )
446+ fhir_service .create_immunization (bad_patient_name_imms , "COVID19.CRUDS " , "Test" )
447447
448448 self .assertTrue (bad_patient_name_msg in error .exception .message )
449449 self .imms_repo .create_immunization .assert_not_called ()
@@ -455,7 +455,7 @@ def test_patient_error(self):
455455
456456 with self .assertRaises (InvalidPatientId ) as e :
457457 # When
458- self .fhir_service .create_immunization (bad_patient_imms , "COVID19:create " , "Test" )
458+ self .fhir_service .create_immunization (bad_patient_imms , "COVID19.CRUDS " , "Test" )
459459
460460 # Then
461461 self .assertEqual (e .exception .patient_identifier , invalid_nhs_number )
@@ -468,7 +468,7 @@ def test_patient_error_invalid_nhs_number(self):
468468
469469 with self .assertRaises (InvalidPatientId ) as e :
470470 # When
471- self .fhir_service .create_immunization (bad_patient_imms , "COVID19:create " , "Test" )
471+ self .fhir_service .create_immunization (bad_patient_imms , "COVID19.CRUDS " , "Test" )
472472
473473 # Then
474474 self .assertEqual (e .exception .patient_identifier , invalid_nhs_number )
@@ -509,7 +509,7 @@ def test_id_not_present(self):
509509 del req_imms ["id" ]
510510
511511 # When
512- self .fhir_service .update_immunization (req_imms_id , req_imms , 1 , "COVID19:update " , "Test" )
512+ self .fhir_service .update_immunization (req_imms_id , req_imms , 1 , "C.CRUDS " , "Test" )
513513
514514 # Then
515515 passed_imms = self .imms_repo .update_immunization .call_args .args [1 ]
@@ -523,7 +523,7 @@ def test_patient_error(self):
523523
524524 with self .assertRaises (InvalidPatientId ) as e :
525525 # When
526- self .fhir_service .update_immunization (imms_id , bad_patient_imms , 1 , ["COVID19:update " ], "Test" )
526+ self .fhir_service .update_immunization (imms_id , bad_patient_imms , 1 , ["C.CRUDS " ], "Test" )
527527
528528 # Then
529529 self .assertEqual (e .exception .patient_identifier , invalid_nhs_number )
@@ -537,7 +537,7 @@ def test_patient_error_invalid_nhs_number(self):
537537
538538 with self .assertRaises (InvalidPatientId ) as e :
539539 # When
540- self .fhir_service .update_immunization (imms_id , bad_patient_imms , 1 , ["COVID19:update " ], "Test" )
540+ self .fhir_service .update_immunization (imms_id , bad_patient_imms , 1 , ["COVID19.CRUDS " ], "Test" )
541541
542542 # Then
543543 self .assertEqual (e .exception .patient_identifier , invalid_nhs_number )
@@ -619,10 +619,10 @@ def test_delete_immunization(self):
619619 self .imms_repo .delete_immunization .return_value = imms
620620
621621 # When
622- act_imms = self .fhir_service .delete_immunization (imms_id , "COVID:delete " , "Test" )
622+ act_imms = self .fhir_service .delete_immunization (imms_id , "COVID.CRUDS " , "Test" )
623623
624624 # Then
625- self .imms_repo .delete_immunization .assert_called_once_with (imms_id , "COVID:delete " , "Test" )
625+ self .imms_repo .delete_immunization .assert_called_once_with (imms_id , "COVID.CRUDS " , "Test" )
626626 self .assertIsInstance (act_imms , Immunization )
627627 self .assertEqual (act_imms .id , imms_id )
628628
0 commit comments