Article

October 20, 2026

Structuring of RESTful APIs in a legacy pathology system: applied study in laboratory modules.

Structuring Restful APIs in a Legacy Pathology System: Applied Study in Laboratory Modules.

Vinicius Mendonça de Oliveira; Arthur Pinheiro De Araújo Costa

DOI: 10.22167/2675-6528-202603542

Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.

Summary

The advancement of information technologies has driven the need to modernize legacy systems to meet the demands of integration, scalability, and maintenance. The study aimed to develop an Application Programming Interface (API) based on the Representational State Transfer (REST) standard, focusing on restructuring the Registration module of a legacy pathology laboratory system, originally built on the Model-View-Controller (MVC) architecture. The methodology employed the analysis of the legacy system, identification of improvements and limitations, and implementation of a new solution with best practices in development. ASP .NET, C#, and Data Transfer Objects (DTOs) were used to standardize communication. The API was structured in layers, separating responsibilities between controller, services, and repositories, and used the HTTP protocol and JSON format for data exchange. As the main result, an improvement was observed in code organization, decoupling between application layers, and the ability to integrate with external systems. It was concluded that adopting an architecture based on RESTful APIs proved to be an efficient development approach for modernizing legacy systems, offering greater flexibility, maintenance, and interoperability.

Keywords: RESTful APIs; Back-end; Model-View-Controller; Pathology systems; Legacy systems.

1. Introduction

Pathology is a complex area of medicine that involves various health professionals, such as pharmacists, biomedical scientists, biologists, chemists, and specialized physicians. In this field, the main objective is to provide laboratory support for diagnosis, the development of conduct guidelines, the determination of new tests, the establishment of prognoses, and the detection of pathologies to monitor therapy (BORGES, 2007). These tests and analyses are fundamental for diagnosing diseases, confirming diagnoses, and guiding appropriate treatment for each patient.

The laboratory process in pathology, although involving detailed manual steps, has been progressively optimized by technology. Initially, the registration of material and patient, screening, fragment handling, staining, storage in cassettes, paraffin embedding, millimeter cutting, and slide preparation are critical phases that culminate in analysis by pathologists for a specific diagnosis (BANCROFT; GAMBLE, 2008). Administrative, financial, and exam release routines, which were previously manual, have been computerized and automated with specific systems (O’BRIEN; MARAKAS, 2013). The automation and computerization of clinical laboratories have resulted in significant improvements in productivity and cost control (Mugnol and Ferraz, 2006).

The digitalization of services and the integration of data in healthcare are essential pillars of the Health Digital Transformation Plan, according to the Ministry of Health (BRASIL, 2020). This initiative aims to expand access to medical information, ensure continuity of care, and optimize resources, ensuring greater diagnostic safety and the agile availability of results and exams throughout the system. Such systems perform various functions, from patient and material registration to the issuance of reports and the control of exams.

However, the complexity and detail of the workflow in pathology represent a considerable challenge for technology. Many existing systems have not kept up with user needs and technological advancements, becoming legacy systems. Although they partially meet demands, these systems present critical limitations regarding integration with other platforms, maintaining many laboratory activities manually. The fragmentation of information among the various modules of the system itself also constitutes a significant obstacle.

In this scenario of obsolescence, modernizing legacy systems through Application Programming Interfaces (APIs) is of paramount importance. APIs are vital components for communication in the universe of software systems, acting as the backbone that connects different applications (PITA, 2024). Developers design APIs to enable integration between applications, creating a digitally interconnected ecosystem, facilitating data access, and ensuring the security and efficiency of offered resources. The use of APIs in the Representational State Transfer (RESTful) model can provide effective solutions to the aforementioned problems, optimizing flows, queries, and enabling new functionalities that streamline laboratory operations, modernizing it with new tools. APIs are seen as a competitive advantage and not just a technical detail (Pinto, 2015).

Given the need for modernization and the relevance of RESTful APIs for system integration and optimization, the present study is justified by the search for solutions that improve the technological infrastructure in pathology laboratories. The research objective is to investigate, through an applied study, how the integration of laboratory modules through RESTful APIs can contribute to the improvement of these legacy systems, providing an enhancement of operational efficiency, data reliability, and user experience in pathology systems.

2. Material and Methods

The research methodology adopted was characterized as a qualitative approach of an applied nature, with a technical case study design. The main objective of the research was to investigate how the integration of laboratory modules, through RESTful Application Programming Interfaces (APIs), can enhance legacy systems in pathology laboratories, aiming for improvements in operational efficiency, data reliability, and user experience.

The object of analysis consisted of the source code of a legacy pathology system, used in a laboratory, focusing on the restructuring of the Registration module. This system, originally developed under the Model-View-Controller (MVC) architecture, served as a basis for demonstrating the modernization proposal and the architectural transition to a model based on RESTful APIs.

For the project development, ASP.NET Web API with C# technologies were employed, using Data Transfer Objects (DTOs) to standardize communication between client and server. The API was structured in layers, separating responsibilities between “controller”, services, and repositories, and used the HTTP (Hypertext Transfer Protocol) and JSON (JavaScript Object Notation) format for data exchange. To ensure ethical compliance and data protection, a functional prototype inspired by the legacy code was used, with synthetic data, without violating copyrights or institutional confidentiality.

The methodological procedures began with the analysis of the legacy system, aiming to understand its architecture and identify limitations. In this phase, the Registration module was selected as the main object of study, due to its centrality in the laboratory workflow and its relationships with other entities, such as exams, patients, and users. It was observed that the legacy system’s MVC architecture presented strong coupling between the presentation and control layers, with extensive use of ViewModels.

After the analysis, the modeling of the new architecture based on RESTful APIs was performed. The main “endpoints”, domain entities, and DTOs were defined, establishing a clear separation between input and output data. The objects RegistroRequest, to represent the data needed for creating a laboratory record, and RegistroResponse, to return data from the database after a request, were created, promoting objectivity and control of the information flow.

The implementation stage involved the development of REST “endpoints” using ASP.NET Web API. Three main “endpoints” were developed: Registration, Editing, and Query. The API architecture was organized into “controller”, services, and repositories layers, following the principle of separation of responsibilities. The “controller” layer acted as the entry point, the service layer concentrated business rules and entity mapping, and the repository layer communicated directly with the database, using SQL Server for data management.

Subsequently, functional tests were performed using tools like Swagger. These tests aimed to validate the behavior of the “endpoints” and the consistency of the data sent and received, verifying if the API met the requirements defined in the modeling phase. Swagger allowed visualization and testing of the API’s requests and responses, facilitating the understanding of the contracts defined between client and server.

Finally, a comparative analysis was performed between the legacy model and the new architecture developed. Aspects such as code organization, decoupling between layers, ease of maintenance, and integration capacity were analyzed. This stage sought to evaluate the improvements achieved with the adoption of the RESTful API-based architecture compared to the legacy MVC system.

3. Results and Discussion

The analysis of the legacy system revealed that the Model-View-Controller (MVC) architecture, although functional for web application development, presented significant limitations in the context of a pathology laboratory, especially regarding integration, scalability, and maintenance. A strong coupling was found between the control layer and the graphical interface, a characteristic that manifested in the extensive use of ViewModels. These ViewModels, which were supposed to represent data for the interface, ended up assuming multiple responsibilities, making the code more complex and heavy, as observed in the original system.

This excessive dependence on the presentation layer made it difficult to reuse business logic in other contexts and prevented efficient integration with external systems. The data types used in the return of the “endpoints” were intrinsically linked to the graphical interface, which limited the system’s flexibility and interoperability. Such a scenario highlighted the need for an architectural modernization that could overcome these barriers, aligning the system with contemporary demands for greater connectivity and efficiency, as emphasized by Pinto (2015) on the competitive advantage of APIs.

Given these observations, the restructuring of the Registration module through the implementation of RESTful APIs proved to be an effective approach to mitigate the identified deficiencies. The main improvement observed was the substantial reduction in coupling between the application and controller layers. In the new model, the controller began to act exclusively as an entry point for HTTP requests, decoupling itself from the presentation layer and allowing business logic to be reused independently of the graphical interface.

The adoption of the RESTful standard and the use of Data Transfer Objects (DTOs) were crucial for this transformation. Specific objects, such as RegistroRequest and RegistroResponse, were defined to manage input and output data, respectively. The RegistroRequest was designed to contain only the attributes necessary for creating a laboratory record, while the RegistroResponse was structured to return relevant data to the user after a request, whether for creation, listing, or consultation, avoiding unnecessary exposure of internal information.

This separation of responsibilities, with distinct DTOs for request and response, established well-defined contracts for client-server communication. This not only standardized data exchange, using the JSON format, but also contributed to the system’s security and organization, ensuring that only consolidated and necessary information was transferred. The approach contrasted with the legacy system, where a single “ViewModel” accumulated input and output functions, generating complexity and coupling.

The developed API architecture was structured in distinct layers: “controller”, services, and repositories. The “controller” is responsible for receiving HTTP requests, validating input data, converting DTOs, and orchestrating calls to the service layers. This organization promoted a clear separation of responsibilities, which is fundamental for code maintainability and evolution, according to software development best practices (CARMO, 2023).

The service layer, in turn, concentrates the application’s business rules. It processes the data received from the “controller”, performs additional validations, and maps RequestDto type entities to domain entities (“Entities”) that will be persisted in the database. Furthermore, the service layer is responsible for mapping entities originating from the database to ResponseDto type entities, ensuring that the presentation layer receives only the necessary data for display.

Complementarily, the repository layer performs the function of direct communication with the database, using frameworks like Entity Framework to persist the data mapped by the service layer. This approach avoids the data layer logic being directly exposed in the “controller”, promoting greater decoupling and adherence to modern software architecture principles. The use of these layers resulted in a more modular, scalable, and easily maintainable system.

The API implementation included the development of three main “endpoints” for the Registration module: Creation, Editing, and Query. These “endpoints” were designed to be accessible via HTTP protocol, using verbs such as POST for creating new records and GET for querying. The documentation of these “endpoints” was carried out using Swagger, a tool that allowed visualizing and testing API requests and responses, facilitating the understanding of communication contracts.

The Swagger interface demonstrated the execution of the “endpoint” for registration, where the request was sent in JSON format, following the structure of the RegistroRequestDTO. In cases of success, the API returned the HTTP code 200 (Ok), indicating that the operation was processed successfully. In error situations, codes such as 400 (Bad Request) or 500 (Internal Server Error) were returned, providing clear feedback on the request status, which is essential for the application’s robustness.

The comparison between the structure of the “ViewModel” of the legacy system and the DTO classes of the new API evidenced a significant evolution. While the “ViewModel” concentrated multiple attributes for input and output, often containing unnecessary fields and exposing internal data, the DTOs were designed to be lean and focused on their specific responsibilities. This reorganization promoted greater clarity in the definition of application flows and in the handling of business rules.

The architecture based on RESTful APIs prioritizes communication and data transfer through DTOs, promoting decoupling between application layers and focusing on data manipulation according to business rules. This approach allows the system to integrate with multiple clients, regardless of the technology used, significantly expanding the possibilities of application use and its adaptability to different platforms, such as mobile applications or other services.

In the healthcare context, the use of APIs as data integration tools represents a remarkable advance in how information is shared among various systems. This approach enables the agile and standardized transmission of critical data, such as exam results and diagnoses, contributing to better clinical decision-making, and reducing errors and delays in care. The biggest beneficiary of this modernization is the patient, who receives more efficient and safer care.

In summary, the comparison between the traditional MVC model of the legacy system and the RESTful API-based approach revealed striking structural and functional differences. The MVC model, with its strong dependence on ViewModels and coupling with the presentation layer, concentrated logic in the “controller” and hindered external integration. In contrast, the RESTful API, with communication via DTOs, layer decoupling, and a focus on data and services, proved to be a more flexible, scalable, and interoperable solution, aligned with the modernization needs of legacy systems.

Although the restructuring was applied to a specific module of the legacy system, which limits the generalization of the results to the entire application, the findings confirm the feasibility and benefits of adopting an architecture based on RESTful APIs. The research demonstrated that this approach is efficient for modernizing legacy systems in pathology laboratories, improving operational efficiency, data reliability, and user experience, fulfilling the objective of investigating the contribution of RESTful APIs to the improvement of these systems.

4. Conclusion

This study investigated how the integration of laboratory modules through Application Programming Interfaces (APIs) based on the Representational State Transfer (REST) standard can enhance legacy systems in pathology, aiming for greater operational efficiency, data reliability, and user experience. It was found that the traditional Model-View-Controller (MVC) architecture of the legacy system presented strong coupling between layers and dependence on the graphical interface, limiting the reuse of business logic and integration with external systems. The restructuring of the Registration module, with the implementation of a RESTful API and the use of Data Transfer Objects (DTOs), demonstrated a substantial reduction in coupling, with the “controller” acting as the entry point for HTTP requests and the business logic separated into service and repository layers. This approach standardized communication via JSON, improved code organization and security, and allowed integration with multiple clients, representing a significant advancement in the modernization of health systems and the optimization of critical patient data sharing.

As a limitation, the restructuring was applied to only one specific module of the legacy system, which restricts the generalization of the results to the entire application. For future studies, it is suggested to extend the implementation of the RESTful architecture to other modules of the system, as well as to incorporate automatic tests and performance monitoring. Furthermore, comparative analyses with other architectures are recommended to deepen the understanding of legacy system modernization in the healthcare area.

Bibliographic References

BANCROFT, J. D.; GAMBLE, M. Theory and practice of histological techniques. 6. ed. Philadelphia: Churchill Livingstone, 2008.

BORGES, Mauricio Ribeiro. Contribuição ao estudo do uso da imagem digital em anatomia patológica, através de um modelo diagnóstico em neuropatologia: proposta de protocolo de rotina. 2007. Dissertação de Mestrado.

BRASIL. Ministério da Saúde. Plano de Transformação Digital da Saúde. Brasília: DATASUS, 2020.

CARMO, Klayver Ximenes. Um estudo comparativo entre tecnologias de back-end: Node. js, Django REST Framework e ASP. NET Core. 2023

MUGNOL, Katia Cristina Ugolini; FERRAZ, Marcos Bosi. Sistema de informação como ferramenta de cálculo e gestão de custos em laboratórios de análises clínicas. Jornal Brasileiro de Patologia e Medicina Laboratorial, v. 42, p. 95-102, 2006.

O’BRIEN, James A.; MARAKAS, George M. Administração de sistemas de informação. 15. ed. Porto Alegre: AMGH, 2013.

PINTO, José Luís Caldeira. API RESTful para Sistema de Gestão de Desempenho de Redes de Telecomunicações. 2015. Dissertação de Mestrado. Universidade de Aveiro (Portugal).

PITA, Pedro Henrique Mendes. Guia Técnico para Apoio no desenvolvimento de API RESTFul seguras. 2024. Dissertação de Mestrado. Instituto Politecnico de Beja (Portugal).

Article originating from the Final Course Work of the Specialization in Software Engineering of the MBA USP/Esalq

To learn more about the course, click here and access the MBX Academy platform

You may also like

Executive Mba In Leadership And Management

November 23, 2026

Improvements in the efficiency of a secondary biological sludge drying plant

The management of industrial solid waste, especially secondary biological sludge, represented an operational and strategic challenge for a company in the pulp and paper sector. A secondary biological sludge drying plant, installed to meet environmental requirements and reduce costs, operated with low efficiency and high unavailability. The objective of this study was to evaluate and propose a set of actions to increase the operational availability of the plant, ensure the integral processing of the generated sludge, and reduce treatment and transportation costs, in addition to mitigating environmental risks. To this end, an analysis of the root causes of low efficiency was carried out, using tools such as the cause-and-effect diagram (Ishikawa) and the “5 whys” analysis, and hypotheses were tested to identify the most impactful factors. Three main root causes were identified: addition of low-load effluent to the process, absence of a dedicated maintenance team, and lower consistency of dewatered sludge. The proposed countermeasures, which included stopping the addition of effluent, hiring a maintenance team, and testing polymers, had a monthly implementation cost of R$ 35,000.00. An annual reduction in operating expenses of up to R$ 1,800,000.00 and maintenance costs of R$ 600,000.00 was estimated, in addition to a 25% reduction in operational unavailability. It was concluded that the proposed measures are viable, quick to implement, and capable of ensuring the integral processing of secondary biological sludge, strengthening the company’s ESG strategy and ensuring environmental compliance.

Keywords: Operational costs; Operational efficiency; ESG; Biological sludge; Sludge drying.

Data Science And Analytics For Operations

November 19, 2026

Polyp-YOLO: an efficient, low-latency detector for polyps in colonoscopies

The early detection of colorectal polyps is crucial for the prevention of colorectal cancer, and real-time computer-aided detection (CADe) systems have shown gains in endoscopic practice. The objective was to develop and validate a lightweight colorectal polyp detector, based on the YOLO architecture, capable of operating on restricted hardware with high precision and low latency. The methodology used public datasets of endoscopic images, partitioning the Kvasir-SEG dataset for training and internal validation, and CVC-ClinicDB and ETIS-Larib Polyp DB for cross-dataset evaluation. Lightweight variants of the YOLOv8, YOLO11, and YOLO26 families with 640×640 pixel input were evaluated. A grid search tested 70 combinations of optimizers and activation functions, and identified AdaBelief and LeakyReLU as the configuration with the best generalization. The optimization pipeline applied unstructured pruning, knowledge distillation, and fine-tuning. The optimized YOLO11n-seg model outperformed the higher-capacity architecture (YOLO26m-seg) in mAP50 and showed similar performance in F1-Score, operating with approximately seven times fewer parameters. It achieved an mAP50 of 0.7929 and an F1-Score of 0.7514 on the ETIS-Larib dataset, and fast inference was demonstrated in different formats, with real-time latencies. The explainability of predictions was validated by Grad-CAM activation maps. The proposed solution demonstrated itself to be a promising experimental tool for diagnostic support, with technical feasibility for integration into environments with reduced computational power, although it requires future clinical validation.

Keywords: Computer-aided detection; Edge computing; Hyperparameter optimization; Endoscopic image segmentation; Medical computer vision.

Data Science And Analytics For Operations

November 19, 2026

Multi-touch Attribution in E-commerce: A Comparison between Markov Chains and Last-Click

The research investigated Multi-touch Attribution (MTA) Models in e-commerce, seeking to overcome the limitations of the Last-Click model, widely used in the market. The objective was to compare the performance of first-order Markov Chains with Last-Click and Position-Based approaches, identifying the value of assistance channels frequently ignored. To this end, Markov Chain algorithms were applied to a large volume of purchase journey data from the Google Merchandise Store, extracted via BigQuery. The study probabilistically mapped the purchase journey and calculated the Removal Effect to quantify channel relevance. The results demonstrated that data-driven models identified the strategic role of discovery (awareness) and assistance channels, which Last-Click neglected in 65% of complex journeys. Simulated financial analysis indicated an approximate 28% hidden efficiency in Cost Per Acquisition (CPA) for Paid Search, compared to the Last-Click model. It was concluded that Markov Chains allowed for a more accurate mapping of purchase journeys, validating the technical feasibility of the modeling and providing evidence for more efficient budget allocation in digital media, mitigating the risk of early divestment in crucial channels.

Keywords: Assistance channels; Data science; E-commerce; Digital marketing; Media optimization.

Project Management

November 19, 2026

Integrated Software for Operational Communication and Control: Practical Evidence in a Medium-Sized Company

The study analyzed the impacts of the lack of integration between commercial and operational modules of an integrated management software (ERP/CRM) in a medium-sized company in the mechanical engineering sector. The main objective was to evaluate practical evidence of communication and operational control optimization, identify bottlenecks, and formulate improvement proposals. A qualitative-quantitative approach was adopted through a single case study with documentary research, based on the extraction and filtering of historical task records from the Bitrix24 software and statistical correlation analysis between workload and allocated team. Based on the diagnosis, an action plan structured in the 5W2H tool was developed. The results revealed that 54.4% of the registered tasks consisted of duplicate, test, or practically useless records, generated by manual insertion during the scope transition between commercial CRM and engineering. It was also demonstrated that the increase in the commercial team linearly accompanied the growth of inefficient tasks, polluting the database and masking the organization’s real productive capacity. It was concluded that the automation of workflows and native integration between modules are essential to mitigate operational and financial risks, providing replicable guidelines for data governance in small and medium-sized enterprises.

Keywords: System Customization; Enterprise Resource Planning (ERP); Task Management; Management Software.

Project Management

November 19, 2026

Supervised learning in voltammetric quantification with electrochemical sensors

The application of supervised learning in the voltammetric quantification of paraquat in artificial urine was evaluated. The study aimed to quantitatively assess the predictive performance of supervised learning models compared to a univariate “baseline”, preserving independence between devices in the training and testing sets. The research was conducted as an applied case study, processing data from four physical devices, each evaluated under a blank condition and six paraquat concentration levels, totaling 28 square wave voltammetry (SWV) curves. A computational “pipeline” integrated automated file reading, organization of curves into current-potential matrices, generation of potential maps, and device-specific blank correction. Five approaches were considered: conventional univariate calibration, predictive univariate “baseline”, partial least squares (PLS) regression, support vector regression (SVR), and random forest (RF). Predictive evaluation was performed using device-grouped cross-validation. PLS showed the best predictive performance for curves from a device not used in training, with an R² of 0.7981. RF exhibited intermediate performance, while SVR and the predictive univariate “baseline” showed inferior and similar performance between themselves. It was concluded that a compact multivariate representation of the voltammetric profile was more favorable for inter-device prediction than increasing model flexibility under the studied conditions. Grouped validation preserved independence, but the limited number of devices restricts the generalization of results.

Keywords: Supervised learning; Paraquat; PLS; Electrochemical sensors; Square wave voltammetry.

Project Management

November 19, 2026

Improvement of Inventory Management via Lean Six Sigma: Study in the Paper Industry

Organizations seek methodologies to reduce waste, increase efficiency, and become more competitive, promoting sustainable improvements in their processes. In this context, the study aimed to apply the Lean Six Sigma methodology, through the DMAIC cycle, to improve inventory management in a company in the paper industry manufacturing pneumatic hoses, aiming to increase the accuracy between physical and systemic inventories and improve the visual management of parts storage. The research was developed from the collection and analysis of data extracted from the company’s ERP system. Tools such as SIPOC, Ishikawa Diagram, and 5 Whys were used to define and identify the root cause of the problem. As improvement proposals, a Digital Kanban system and an adaptation of the Two-Bin system, called the Three-Bin System, were implemented, in addition to the development of standardized operating procedures and the establishment of control mechanisms. The results demonstrated a significant improvement in inventory accuracy, raising the lowest identified index from 28% to 80%, and detected discrepancies between systemic and physical records equivalent to R$ 134,335.53. It was concluded that the application of Lean Six Sigma, combined with Project Management, represented an effective approach for conducting operational improvement projects, contributed to increased reliability of inventory information, to the improvement of material control processes, and to the strengthening of the organization’s operational management.

Keywords: Inventory accuracy; DMAIC; Visual management.

Data Science And Analytics For Operations

November 19, 2026

Predictive Analysis Methodology for Performance Optimization in E-commerce: Correlation between Public Data and Paid Media

A predictive analysis methodology was developed for e-commerce, integrating transactional data and public search trends. The objective was to develop and validate a predictive model, based on machine learning algorithms, capable of correlating organic search trends with sales performance and paid media costs in the Beauty and Health category of Brazilian e-commerce. The Brazilian E-Commerce Public Dataset by Olist and data from Google Trends were used, processed in Python with the Random Forest Regressor algorithm. A moderate inverse correlation (r = -0.43) with a seven-day lag was identified between organic search volume and purchase. Initial models, based solely on behavioral variables, presented insufficient metrics (R² = -0.47; MAE of R$ 2,120.54). The incorporation of microeconomic (average ticket and shipping) and macroeconomic (exchange rate and Ibovespa index) variables raised the R² of the final model to 0.29, with an MAE of R$ 1,489.63, representing a 24.7% reduction in error compared to the baseline. Temporal cross-validation showed that, in periods of mature operation (2018), the model achieved an R² of 0.42. It was concluded that isolated search volume explains the moment of consumer interest, but not the financial magnitude of sales, making the fusion with transactional and economic data mandatory for predictive viability.

Keywords: Beauty and Health; Consumer Behavior; Google Trends; Machine Learning; Time Series.