Second line should be:

Set status=context.ReturnedIds.SetAt(callresponse.PatientLookupResult.Patients.GetAt(1).IDs.GetAt(1).ID, 1)

You need to modify your BP definition to something like this:

<assign property="context.ReturnedIds" value="callresponse.PatientLookupResult.Patients.GetAt(1).IDs.GetAt(1).ID" action="set" key="1"/>

To copy all IDs for all patients you'll need to iterate over results.