lb-domain-transformation

Transform horizontal lab data into vertical SDTM LB records.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/siddharthchauhan/ETL --skill lb-domain-transformation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lb-domain-transformation
Source: https://github.com/siddharthchauhan/ETL/tree/main/sdtm_pipeline/deepagents/skills/lb-domain-transformation
Command: npx skills add https://github.com/siddharthchauhan/ETL --skill lb-domain-transformation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Lab data often arrives in horizontal format where each row is a subject-visit and each column is a lab test. The LB domain requires vertical records, with LBTESTCD, LBTEST, LBORRES, and related fields. This Skill automates detecting orientation, melting horizontal data to vertical SDTM LB format, and applying a robust test-mapping strategy.

Core Features & Use Cases

  • Automatic orientation detection: identifies whether input is horizontal or vertical and selects MELT transformation when needed.
  • LB mapping and MELT transformation: uses a comprehensive LAB_TEST_CODE_MAP to populate LBTESTCD, LBTEST, LBCAT, and LBORRES fields during the melt.
  • Specimen inference & basic data cleaning: infers LBSPEC from domain/category and handles date/epoch fields to populate LBSEQ, VISIT, EPOCH, and LBDTC.
  • Use Case: Given a dataset with multiple subjects and visits in a wide format (one row per subject with many test columns), convert to vertical LB format suitable for SDTM submission and downstream validation.

Quick Start

To transform a horizontal LB dataset, run the lb-domain-transformation skill to melt the data and generate vertical LB records ready for SDTM alignment.

Frequently Asked Questions about lb-domain-transformation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert horizontal lab data to vertical SDTM LB format?

To convert horizontal lab data to vertical SDTM LB format, the Skill detects the input orientation and applies a MELT transformation to reshape subject-visit rows into vertical records. It maps LBTESTCD, LBTEST, and LBORRES fields automatically during the melt.

How does specimen inference work for SDTM LB domain records?

Specimen inference for SDTM LB records populates the LBSPEC field by deriving the specimen type from the lab domain and category. This automated inference ensures vertical LB records meet SDTM submission requirements without manual specimen typing.

Can I transform multiple subjects and visits from wide format into SDTM LB records?

Yes, you can transform multiple subjects and visits from wide format into SDTM LB records. The Skill processes datasets where each row represents a subject-visit with multiple test columns and prepares vertical LBSEQ, VISIT, EPOCH, and LBDTC fields.

What is the best way to map lab test codes for SDTM submission?

The best way to map lab test codes for SDTM submission is using a comprehensive LAB_TEST_CODE_MAP to populate LBTESTCD, LBTEST, and LBCAT fields. This ensures consistent test mapping across all vertical LB records during the MELT transformation.

Does the lab data transformation handle basic data normalization for SDTM?

Yes, the lab data transformation handles basic data normalization for SDTM by cleaning date and epoch fields to populate LBDTC, VISIT, and EPOCH. It also prepares LBORRES and LBSTRESU fields for SDTM-ready datasets.

What happens if my lab data is already in vertical format instead of horizontal?

If your lab data is already in vertical format, automatic orientation detection identifies the structure and skips the MELT transformation. The Skill then proceeds directly to test mapping, specimen inference, and data normalization.