How is Scotland's public sector preparing for Brexit?
With the UK due to leave the EU in six months, how ready are Scotland's public bodies for Brexit? A BBC Scotland investigation has attempted to find out.
The BBC asked 80 public bodies in Scotland for details of their Brexit preparations and any impact assessments they have carried out, ahead of the planned exit on 29 March 2019.
The freedom of information requests revealed widespread concerns about the potential loss of EU migrants from the workforce.
Publicly funded organisations including the NHS, universities and councils are also weighing up a range of other potential Brexit challenges and opportunities.
Here are the key findings from the investigation, broken down by sector.
NHS Lanarkshire has warned there is a "very high" risk it will not be operationally ready for Brexit leading to possible disruption of healthcare services.
The board said it was working with the Scottish government to identify and overcome problems.
Across the health service, there are concerns about access to specialist medicines, equipment and doctors after EU withdrawal.
A paper for the board of NHS national services Scotland raised a concern that Brexit could end UK membership of the European Blood Alliance (EBA).
This could result in "loss of early visibility on emerging infectious diseases" and force a Scottish blood expert to come off the EBA's executive board, the paper said.
The Scottish Funding Council (SFC) has been considering possible Brexit effects on EU students, funding and research.
In 2015/16, 22,405 EU nationals studying in Scotland were entitled to Scottish government funding.
A confidential SFC paper from October 2017 assumes that "equal treatment of Scottish and EU students will cease to apply" after Brexit.
That, the paper said, would give ministers options including the "release of around £95m of teaching grant and fees for other Scottish government priorities".
All EU students starting courses in Scotland in 2019/20 or before will have their tuition fees paid throughout their studies.
Both the Student Awards Agency and the Scottish Qualifications Authority have highlighted the need for greater clarity on the implications of Brexit.
The Scottish government published a paper on the justice and security implications of Brexit in June. It raises concerns about reduced police cooperation through Europol and the potential loss of the European Arrest Warrant.
The UK government hopes to negotiate a new security partnership with the EU, maximising continued cooperation.
But Scottish justice secretary Humza Yousaf said last week that a "complete lack of any clarity" from the UK was hampering Brexit preparations.
The Scottish Prison Service expects Brexit to change the arrangements for prisoner transfers with EU countries. It has assessed the impact as "low" because of the relatively small number of prisoners likely to be affected.
The Scottish Courts Service said it was working on a fast-track procedure to remove references to EU law from court rules.
Police Scotland has a dedicated team working on Brexit but the force and its governing body the Scottish Police Authority have yet to respond to the BBC's request for further information.
Scottish Enterprise has launched a 'Get Set For Brexit' toolkit to help businesses prepare for what it describes as a "fundamentally new operating environment".
Skills Development Scotland said it was working with a large textiles employer on a pilot project to identify key questions businesses need to consider.
The Scottish Futures Trust, which arranges funding for infrastructure projects, said it had not made a "general assessment" of the likely impact of Brexit.
However, a 2016 paper on the school building programme raised the possibility that leaving the EU could "exacerbate the skills shortage in the construction industry".
Food and Environment
As 90% of food and feed law stems from EU membership, Food Standards Scotland said it had advised the Scottish government on the changes required to maintain consumer protection.
The Scottish Environment Protection Agency (SEPA) expects the immediate adjustment to Brexit "is likely to be straightforward".
Its longer term concern is the perceived "risk that UK environmental laws will 'lag behind' those of the rest of Europe".
Scottish Natural Heritage said it had appointed a full-time EU exit coordinator and was giving priority to updating advice and guidance for the public.
A key concern for local government is future funding.
The UK government has guaranteed to honour EU funding programmes until 2020 but councils are still nervous about the years beyond that.
North Lanarkshire said it had a "working assumption" that Brexit would lead to a "further squeezing of public sector budgets".
Highland Council said the lack of structural and regional development schemes to replace EU funds was a "significant risk" for the area.
Dundee is worried there has been "no guarantee" of post-Brexit participation in the Interreg programme which allows exchange of expertise.
Procurement is another important issue with Scottish Borders contemplating "potential spikes in the cost of goods and services" in the event of a "chaotic" Brexit. A council official has floated the idea of buying £5m worth of steel for a Hawick flood scheme before EU departure to avoid any price volatility.
North Ayrshire said "potential opportunities from Brexit are much harder to identify and quantify".
Fife has suggested European twin town relationships could help "chart a smooth path" through Brexit.
Major local authorities like Glasgow, Edinburgh, Aberdeen and Dundee have produced detailed reports on Brexit.
Many smaller councils have not, with Inverclyde reporting "no preparations or assessments have been made". Ditto Clackmannanshire.
Stirling and West Dunbartonshire said they had "no recorded information". East Ayrshire provided a "nil response".
The local government umbrella body Cosla is carrying out extensive work on behalf of all councils.
A detailed briefing paper by Transport Scotland from March 2018 raises concerns about road haulage to the continent after Brexit.
The document anticipates increased truck checks at the Channel ports, even if there's not a "physical border".
It suggests this would cause particular problems for Scottish hauliers who come close to the legal limit for driver hours when travelling from the central belt to Dover or Channel Tunnel.
According to Transport Scotland, "the impact of any further delay at customs might be more than marginal leading to the need for an overnight stop" and additional haulage costs.
CMAL - which owns ferries operated by Caledonian MacBrayne and Serco Northlink - said a "hard Brexit" could cause a "breakdown in the supply chain" and delay future ferry orders.
Highland council said relatively small reductions in air travel, if trade with the EU reduced, could put at risk international routes from Inverness airport.
Tourism and Culture
Visit Scotland's concerns include possible changes to open sky agreements, which "could adversely affect the ability of visitors to travel to Scotland".
Historic Environment Scotland has number crunched the impact a post-Brexit recession might have on its revenue and considered how that could be offset by a ticket price increase.
The National Galleries are mindful that "changes in regulation could bring extra bureaucracy and cost making it more difficult, for example, to mount international exhibitions".
As well as considering potential Brexit downsides, the National Library sees a possible upside: "renewed interest in Scottish literature, culture and events to support tourism" if Scotland's identity is repositioned on the world stage.