File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def initialize(vaccination_record)
99 end
1010
1111 def fhir_record
12- immunisation = FHIR ::Immunization . new
12+ immunisation = FHIR ::Immunization . new ( id : nhs_immunisations_api_id )
1313
1414 if performed_by_user . present?
1515 immunisation . contained << performed_by_user . fhir_practitioner (
Original file line number Diff line number Diff line change 1313 let ( :session ) { patient_session . session }
1414 let ( :vaccination_outcome ) { :administered }
1515 let ( :vaccine ) { vaccination_record . vaccine }
16+ let ( :nhs_immunisations_api_id ) { nil }
1617 let ( :vaccination_record ) do
1718 create (
1819 :vaccination_record ,
2122 programme :,
2223 session :,
2324 vaccine : programme . active_vaccines . first ,
24- outcome : vaccination_outcome
25+ outcome : vaccination_outcome ,
26+ nhs_immunisations_api_id :
2527 )
2628 end
2729 let ( :user ) { vaccination_record . performed_by_user }
3335 # expect(immunisation_fhir.to_hash).to eq fhir_immunisation_json(patient:)
3436 # end
3537
38+ describe "id" do
39+ subject { immunisation_fhir . id }
40+
41+ context "when the vaccination record no UUID" do
42+ it { should be_nil }
43+ end
44+
45+ context "when the vaccination record has a UUID" do
46+ let ( :nhs_immunisations_api_id ) { "1212-1212-1212-121212121212" }
47+
48+ it { should eq "1212-1212-1212-121212121212" }
49+ end
50+ end
51+
3652 describe "contained patient" do
3753 subject { immunisation_fhir . contained . find { it . id == "Patient1" } }
3854
You can’t perform that action at this time.
0 commit comments