Interface


Interface
├── Device Interface
│   ├── User-level components
│   └── Kernel-level device drivers
├── User Interface
│   ├── Web-based UI (PyScript & JavaScript)
│   ├── Dedicated UI (iOS & watchOS)
│   ├── Local Standalone UI
│   └── Local-backended UI (Balancing web-based heavy load)
└── Embedded Scripting Interface
    ├── R Packages
    └── Python Interpreter

Device Interface

The device interface includes both (1) user-level components, such as APIs and libraries, and (2) kernel-level device drivers, which together enable software to interact with hardware devices.

In the hemodynamic software, Project nGene.org®, for iOS and watchOS devices, user-level device interfaces will be utilized, while kernel-level device drivers will have been implemented in a Debian Linux environment for robots and echocardiography systems.


User Interface

A user interface ensures that users can effectively interact with the system, thereby enhancing the overall user experience.

In Project nGene.org®, the user interface will include (1) a web-based UI built with PyScript and JavaScript, (2) a dedicated UI for iOS and watchOS, (3) a local standalone UI, and (4) a local-backended UI designed to balance the heavy load of the web-based PyScript and JavaScript components.


Embedded Scripting Interface

An Embedded Scripting Interface is a component within a software application that allows users to write and execute custom scripts in real-time using a programming language such as Python or R. This interface provides the flexibility to interact with the application’s internal functionality, perform complex computations, or extend features without modifying the core code. By integrating interpreters like Python or R, users can leverage powerful scripting capabilities, making the software highly customizable and adaptable to various use cases such as data analysis, automation, or integration with other tools.


For "(D) iOS and watchOS Devices"
(Available in Apple Store Late 2024)


Apple iOS and watchOS Companion App, Project nGene.org®:

User Manual for Enhancing Clinical Workflow for Hemodynamics with Handheld Devices

Table of Contents

- Innovating with Purpose: The Design Ethos of Project nGene.org
   - User Notice: Privacy, Ethics, and Responsibility

User-Level Device Interfaces
   - watchOS Companion App, with WatchConnectivity
   - iOS App Scan Tab, powered by VisionKit

User Interfaces
   - Echocardiography Mode
   - Ventilator Mode (Beta Feature)


This user manual is dedicated to the commercial Apple iOS and watchOS companion app titled "Project nGene.org®." While the app is an essential part of the larger open-source initiative, Project nGene.org®, which embodies my lifelong commitment to its ongoing development and enhancement, the app itself is offered as a commercial product for the iOS and watchOS user interfaces and user-level device interfaces through VisionKit and WatchConnectivity.

The Apple iOS and watchOS companion app, while primarily serving as the user interface for the broader project, is scheduled for commercial release on the Apple App Store under the same name. However, this application goes beyond the functions of a standard user interface. It is meticulously designed to provide an innovative and streamlined workflow, specifically tailored to assist clinicians in efficiently managing tasks related to hemodynamics.


Innovating with Purpose: The Design Ethos of Project nGene.org®

As both a medical doctor and a software engineer, with experience in echocardiography and serving as an IRB chair, I bring a unique, chimeric perspective to the development of the "Project nGene.org®" app. This dual expertise is crucial in navigating the challenges outlined in three seminal works: The Mythical Man-Month, The Innovator's Prescription, and Crossing the Chasm.

The Mythical Man-Month: In the interdisciplinary world of software and medicine, I have learned that communication is key to bridging the gap between different fields—what I call the "Apple and Orange" problem. This lesson was driven home by my experiences and reinforced by Fred Brooks' The Mythical Man-Month. Brooks warns that simply adding more manpower to a project often increases complexity rather than reducing it. As a chimera, trained in both fields, I strive to minimize this intercommunication complexity, ensuring that the app remains manageable and effective without the need to constantly increase resources.

The Innovator's Prescription: The Project nGene.org app is not designed to guarantee perfect accuracy in recognizing visual or auditory data through its camera or microphone. Instead, drawing from The Innovator's Prescription, the app's primary objective is to disrupt traditional clinical workflows by simplifying and democratizing complex medical processes. My goal is to enhance the clinical experience, making it more efficient and cost-effective, while keeping the app accessible to a broader audience. Additionally, by making parts of the codebase open-source, we are fostering a collaborative environment that invites continuous innovation and improvement.

Crossing the Chasm: Finally, in alignment with Geoffrey Moore's Crossing the Chasm, this app is strategically focused on identifying and capturing its niche market within the healthcare industry. By targeting a specific segment that values innovation, efficiency, and cost-effectiveness, the app aims to establish a strong foothold and gradually expand its user base. I am committed to ensuring that the app not only provides core technology but also offers a comprehensive ecosystem of support and services. This approach ensures seamless integration into existing clinical workflows, addressing the pragmatic needs of a broader user group and facilitating the app's transition from early adopters to the early majority.

In developing Project nGene.org®, I have blended my roles as a doctor and software engineer to create an app that not only meets current clinical needs but also paves the way for future innovation in healthcare.


User Notice: Privacy, Ethics, and Responsibility

Upon launching the Project nGene.org® iOS App for the first time or after a factory reset, users are presented with essential reminders regarding privacy, ethics, and responsibility. These guidelines, which align with both the Organisation for Economic Co-operation and Development (OECD) Guidelines and the General Data Protection Regulation (GDPR), are crucial for ensuring the secure and ethical use of the app in clinical settings.

The foundation of privacy protection in the United States is rooted in the Fair Information Practice Principles established in 1973. In the European Union, privacy legislation began with the Data Protection Directive in 1995, which was later expanded by the GDPR in 2016 to enforce comprehensive data protection standards across all EU member states. However, a more universally recognized framework for personal privacy is provided by the OECD Guidelines on the Protection of Privacy and Transborder Flows of Personal Data, first introduced in 1980 and updated in 2013. These guidelines, along with the GDPR, lay out core principles designed to safeguard the privacy of individuals and ensure responsible data handling (Data Science by John D. Kelleher and Brendan Tierney, MIT Press Essential Knowledge series).

Privacy Protection: The app adheres strictly to the OECD Guidelines on the Protection of Privacy and Transborder Flows of Personal Data and fully complies with the privacy standards set forth by the GDPR. Users must agree to these principles before gaining access to the app's features, emphasizing the importance of safeguarding personal data and maintaining the integrity of data subjects.

Key principles include:

Terms of Agreement: By agreeing to the terms outlined in this app, users acknowledge that the creators of the Project nGene.org app are not liable for any errors, omissions, or inaccuracies in the information provided, nor for any reliance on such information.

Before proceeding to use the app, users are encouraged to thoroughly review these reminders and agreements. Understanding and adhering to these principles is vital for the privacy, security, and ethical use of the Project nGene.org app in clinical environments, paving the way for innovative and secure healthcare solutions.



User-Level Device Interfaces

watchOS Companion App, with WatchConnectivity

Quick-Access to iOS-Stored Information

To use the watchOS companion app for "Project nGene.org," users must first interact with the iOS app. Begin by selecting the "Send to Apple Watch" button located in the Patient View under the Patients Tab of the iOS app. This action transfers patient data to the Apple Watch.

Upon launching the watchOS companion app, users are presented with a concise overview of patient information in the Patient View. By selecting a specific patient entry, the app navigates to the Patient Detail View, where more detailed information is displayed, including the patient's ID, Sort By criteria, Chief Complaint (CC), recommended Actions, and a list of associated diseases.

The watchOS app also includes a feature called the "[Clinical Data]" toggle. When this toggle is activated, it reveals basic clinical information for each patient. This functionality is designed to give healthcare professionals quick and convenient access to essential clinical data directly on their wrist, enhancing the efficiency of patient management.

The navigation in the watchOS app mirrors that of the iOS app, enabling seamless transitions between the Patient View and the Patient Detail View. In the Patient View, users can scroll to the top to find a Reset button, which resets the data within the watchOS app without affecting the data in the iOS app. To update or re-sync the data on the watchOS app, users can simply click the "Send to Apple Watch" button again in the iOS app, initiating a new transfer of the latest stored data from the iOS app to the watchOS app.

Data Synchronization and Communication in watchOS App

Establishing a 1:1 Relationship: This watchOS app utilizes Apple’s WatchConnectivity framework to enable seamless communication and data synchronization between an iPhone and its paired Apple Watch, establishing a 1:1 relationship. The communication between the devices is managed by a WCSession object, which is the core component responsible for this interaction. The session is initialized and activated in the WatchAppReceiver class’s init() method:

if WCSession.isSupported() {
    WCSession.default.delegate = self
    WCSession.default.activate()
}
By calling WCSession.default.activate(), the app sets up the communication channel, ensuring that the iPhone and Apple Watch are ready to exchange data exclusively with each other. This 1:1 pairing ensures that patient data is securely transferred from the iPhone directly to its corresponding Apple Watch, keeping both devices in sync.

Handling Incoming Data: Once this connection is established, the iPhone app initiates the transfer of patient data to the Apple Watch via the WatchConnectivity session. Upon receiving the data, the watchOS app triggers a method in the WatchAppReceiver class specifically designed to handle these communications. This is done through the session(_:didReceiveMessage:) method, which checks the validity of the incoming data:

guard let patientData = message["patientData"] as? Data else {
    print("Invalid patient data received")
    return
}
Once validated, the data is decoded from its serialized format into a structured array of patient information using JSON decoding:

let patients = try JSONDecoder().decode([Patient].self, from: patientData)
This decoded data is then stored locally on the Apple Watch in a property called receivedPatients, ensuring that the information remains accessible even if the app is closed and reopened. The use of persistent storage mechanisms, such as @AppStorage, allows the data to be retained across multiple sessions of the app, maintaining consistency and reliability.

Handling Larger Datasets: The watchOS app is also capable of handling larger datasets or files sent from the iPhone. This is managed by the session(_:didReceive:) method in the WatchAppReceiver class, which processes these files by reading their contents:

let data = try Data(contentsOf: file.fileURL)
    let patients = try JSONDecoder().decode([Patient].self, from: data)
The data within the file is decoded into patient information just like with smaller messages, and then the app's interface is updated to display the most recent patient data. This process is carefully managed using DispatchQueue.main.async:
DispatchQueue.main.async {
    self.receivedPatients = patients
}
This ensures that any updates to the user interface occur on the main thread, keeping the app responsive and providing a smooth user experience.

Resetting Stored Data: Furthermore, the app includes a resetStoredPatients() function that allows users to reset the patient data stored on the Apple Watch without affecting the data on the iPhone:

func resetStoredPatients() {
    storedPatientData = nil
    receivedPatients = []
}
This flexibility is key in managing patient information across devices, allowing healthcare professionals to maintain up-to-date and easily accessible clinical data directly on their wrist.


iOS App Scan Tab, powered by VisionKit

The Scan Tab in "Project nGene.org" is designed to enable users to efficiently capture information from both paper documents and digital screens using the camera of an iPhone. This tab is equipped with two key features—"Auto Select" and "Manual Select"—allowing users to choose the most convenient method for capturing patient identification or other relevant data. Once captured, the text is displayed in a designated area labeled "Scanned Text will be shown here."

Auto Select & Manual Select

The Scan Tab of "Project nGene.org" offers two distinct methods for capturing text via the iPhone camera, tailored to user preference and specific scenarios: Auto Select and Manual Select.

Auto Select: In this mode, the app automatically identifies the area of the document or screen to be scanned. This is visually indicated by yellow rectangular lines that highlight the selected region. This feature is particularly useful for quick scanning, as it requires minimal user input and efficiently identifies the relevant text area.

Manual Select: This option provides users with greater control over the scanning process. After taking a picture, users can adjust four circles on the screen to define the scanning area. Only the text enclosed within these circles will be scanned. This method is ideal for situations where precise selection of text is necessary, allowing users to exclude irrelevant information and focus on the specific data they need.

Both of these selection modes in the Scan Tab enhance the flexibility and efficiency of information capture, catering to various user needs and document types—whether it’s quickly scanning a straightforward document or meticulously selecting specific information from a complex page.

Code Implementation for Scanning

The "Project nGene.org" app leverages the VisionKit framework to offer two distinct scanning features: Auto Select and Manual Select. The key difference between these features lies in how each is implemented using the DataScannerViewController and VNDocumentCameraViewController. These differences determine whether the app automatically detects and scans text or allows the user to manually select the scanning area.

Auto Select: The Auto Select feature is enabled by the DataScannerViewController. This controller is specifically designed for automatic text recognition. The relevant code snippet below shows how the DataScannerViewController is set up to start scanning immediately upon initialization:

func makeUIViewController(context: Context) -> DataScannerViewController {
let recognizedDataTypes: Set = [.text()]
let dataScanner = DataScannerViewController(recognizedDataTypes: recognizedDataTypes, isHighlightingEnabled: true) dataScanner.delegate = context.coordinator try? dataScanner.startScanning()
return dataScanner }
In this setup, the DataScannerViewController automatically identifies and highlights areas of text within the camera’s view, making it ideal for quick, hands-free scanning. The automatic detection and real-time highlighting of text areas provide a seamless user experience, requiring minimal user interaction.

Manual Select: The Manual Select feature is implemented through the VNDocumentCameraViewController. This controller allows users to manually capture and select the area of the document they wish to scan. The code snippet below shows how the VNDocumentCameraViewController is initialized:

func makeUIViewController(context: Context) -> VNDocumentCameraViewController {
    let scanner = VNDocumentCameraViewController()
    scanner.delegate = context.coordinator
    return scanner
}
After the document is captured, users can manually adjust the scanning area to focus on specific text. This level of control is ideal for situations where precision is required, such as scanning specific sections of a complex document.



User Interfaces

Echocardiography Mode

This feature has been launched as the user interface for the underlying core infrastructures of Project nGene.org. This integration marks a significant advancement in harnessing the full potential of the project, providing healthcare professionals with an intuitive and powerful tool.

Tailored Echocardiographic Values

Special attention is given to normal echocardiographic values across different patient groups, including neonatal (categorized by gestational age and hospital day, if provided), pediatric (further differentiated by age groups), and adult patients. Whenever possible, normal ranges derived from peer-reviewed scientific journals or textbooks are displayed, tailored to patient age, gestational age, hospital day, and gender. These values are accompanied by reference links to ensure academic accuracy, which is particularly critical for neonatal and pediatric patients, where adult echocardiographic norms often dominate. This approach ensures precise echocardiographic measurements for these sensitive populations.

Additionally, I have included my personal study notes from my preparation for echocardiography certification exams, such as the ASCeXAM and KSE. Although informal, these notes are intended to make it easier for users to recall key concepts. You can access these study notes by enabling the toggle labeled "Echo Exam Notes" in the settings.

Measurment and Pathophysiology Perspective

This mode has been meticulously developed to present echocardiography measurements in a format aligned with each specific variable, enhancing clarity in measurement interpretation. Initially, it displays data from echocardiography machines in a structured format. It then intelligently reorganizes these measurements to offer a more analytical perspective. The unique dual-view design of this mode supports a comprehensive and in-depth evaluation of cardiac function, thereby improving the accuracy and thoroughness of cardiac assessments. Furthermore, this mode is crafted to streamline the process of scanning and displaying variable values from echocardiography screens, ensuring that the most relevant data is readily accessible and clearly presented.


Ventilator Mode (Beta Feature)

These beta features have been introduced as the user interface for the underlying core infrastructures of Project nGene.org. Although still in development, this mode is thoughtfully designed with a focus on practicality in clinical scenarios. It offers an intuitive tool that is particularly useful for guiding the process of ventilation weaning and assisting clinicians in determining the most appropriate ventilator settings to ensure optimal patient care. This integration represents significant progress in harnessing the project’s capabilities, with a strong commitment to enhancing clinical practices and improving patient outcomes.

Key Functionalities:

Future Developments:


Back to Top