While not knowing exactly the format of your incoming json, I'd use something like this in powershell / pwsh:
curl ... | % { wget (convertto-json $_).output.url } >> patients-pre.json
The % is an alias for ForEach-Object which will iterate over objects (or lines of text) sent from the left side of the pipe. Powershell is interesting because when using the pipe symbol, there's an implicit for / do / done operation going on.
curl is on all modern versions of windows, so you don't need to change that. wget isn't, but you could install it, or use curl again.
If you want to go full powershell, look at invoke-restmethod ( https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.2 ). This can do the jobs of both curl and wget in your example, and also automatically handle json returns to give you a structured object instead of text (which is what convertto-json is doing above.)
pwsh.exewhich isPowershell(without core in the name) versespowershell.exewhich isWindowsPowershellThe docs follow this