Controlled technology and not easily built from scratch even by Starfleet engineers.
The Relaunch novelverse expanded the concept and importance of industrial replicators. When Voyager returned to the Delta Quadrant, she led an small ‘Full Circle’ fleet that included a large engineering ship that did have industrial replicators large enough to reconstruct ships when severely damaged.
Lowere Decks and Prodigy have brought industrial replicators into onscreen canon.
Prodigy gave the Protostar prototype ship an industrial replicator large enough to construct shuttles. Lower Decks has shown the Cerritos and other ships tasked with delivering and bringing online very large industrial replicators on planets seeking Federation support.
It sounds like he was in premed when he met his wife, but then went on a different track while she became a physician.