@@ -276,13 +276,21 @@ async def test_fhir_assemble_sub_questionnaire(fhir_client, safe_db):
276276
277277@pytest .mark .asyncio
278278async def test_assemble_double_nested_sub_questionnaire (fhir_client , safe_db ):
279+ m1 = fhir_client .resource ("Mapping" , body = {"resourceType" : "Bundle" , "type" : "transaction" })
280+ await m1 .save ()
281+ m2 = fhir_client .resource ("Mapping" , body = {"resourceType" : "Bundle" , "type" : "transaction" })
282+ await m2 .save ()
283+ m3 = fhir_client .resource ("Mapping" , body = {"resourceType" : "Bundle" , "type" : "transaction" })
284+ await m3 .save ()
285+
279286 get_family_name = await create_questionnaire (
280287 fhir_client ,
281288 {
282289 "status" : "active" ,
283290 "extension" : [
284291 make_launch_context_ext ("LaunchPatient" , "Patient" ),
285292 make_item_population_context_ext ("%LaunchPatient.name" ),
293+ make_questionnaire_mapper_ext (m3 .id ),
286294 ],
287295 "item" : [
288296 {
@@ -301,6 +309,7 @@ async def test_assemble_double_nested_sub_questionnaire(fhir_client, safe_db):
301309 "extension" : [
302310 make_launch_context_ext ("LaunchPatient" , "Patient" ),
303311 make_item_population_context_ext ("%LaunchPatient.name" ),
312+ make_questionnaire_mapper_ext (m2 .id ),
304313 ],
305314 "item" : [
306315 {
@@ -323,6 +332,9 @@ async def test_assemble_double_nested_sub_questionnaire(fhir_client, safe_db):
323332 {
324333 "status" : "active" ,
325334 "resourceType" : "Questionnaire" ,
335+ "extension" : [
336+ make_questionnaire_mapper_ext (m1 .id ),
337+ ],
326338 "item" : [
327339 {
328340 "linkId" : "demographics" ,
@@ -349,6 +361,9 @@ async def test_assemble_double_nested_sub_questionnaire(fhir_client, safe_db):
349361 "status" : "active" ,
350362 "extension" : [
351363 make_launch_context_ext ("LaunchPatient" , "Patient" ),
364+ make_questionnaire_mapper_ext (m1 .id ),
365+ make_questionnaire_mapper_ext (m2 .id ),
366+ make_questionnaire_mapper_ext (m3 .id ),
352367 make_assembled_from_ext (q .id ),
353368 ],
354369 "item" : [
0 commit comments