Task 811: .WL File Format

Task 811: .WL File Format

File Format Specifications for .WL

The .WL file format, as used in medical imaging contexts (e.g., by tools like DCMTK and Orthanc), refers to DICOM Modality Worklist files stored with the .wl extension. These are binary files conforming to the DICOM (Digital Imaging and Communications in Medicine) standard, specifically the DICOM File Format defined in PS3.10 of the DICOM specification, containing Modality Worklist Information Model attributes as per PS3.3 and PS3.4. The format includes a 128-byte preamble (often zeros), a "DICM" magic string, file meta information, and a sequence of data elements encoded with tags, value representations (VRs), lengths, and values. Worklist-specific content follows the Modality Worklist SOP Class (UID: 1.2.840.10008.5.1.4.31). There is no unique "header" beyond the standard DICOM structure, and files may use explicit or implicit VR transfer syntax.

  1. List of all properties of this file format intrinsic to its file system:
    These properties are the DICOM attributes (data elements) defined for the Modality Worklist Information Model (from DICOM PS3.4 Table K.6-1). Each includes a tag (group,element), name, and requirement type (1=mandatory, 1C=conditional mandatory, 2=required but may be empty, 2C=conditional required, 3=optional). These are intrinsic as they define the structured binary content stored in the file system.
  • (0040,0100) Scheduled Procedure Step Sequence - 1
  • (0040,0001) Scheduled Station AE Title - 1
  • (0040,0002) Scheduled Procedure Step Start Date - 1
  • (0040,0003) Scheduled Procedure Step Start Time - 1
  • (0008,0060) Modality - 1
  • (0040,0006) Scheduled Performing Physician's Name - 2
  • (0040,0007) Scheduled Procedure Step Description - 1C
  • (0040,0010) Scheduled Station Name - 2
  • (0040,0011) Scheduled Procedure Step Location - 2
  • (0018,990C) Referenced Defined Protocol Sequence - 3
  • (0008,1150) Referenced SOP Class UID - 1
  • (0008,1155) Referenced SOP Instance UID - 1
  • (0018,990D) Referenced Performed Protocol Sequence - 3
  • (0008,1150) Referenced SOP Class UID - 1
  • (0008,1155) Referenced SOP Instance UID - 1
  • (0040,0008) Scheduled Protocol Code Sequence - 1C
  • (0040,0440) Protocol Context Sequence - 3
  • (0040,A040) Value Type - 1
  • (0040,A043) Concept Name Code Sequence - 1
  • (0040,A120) DateTime - 1C
  • (0040,A123) Person Name - 1C
  • (0040,A160) Text Value - 1C
  • (0040,A168) Concept Code Sequence - 1C
  • (0040,A30A) Numeric Value - 1C
  • (0040,08EA) Measurement Units Code Sequence - 1C
  • (0040,0012) Pre-Medication - 2C
  • (0040,0009) Scheduled Procedure Step ID - 1
  • (0032,1070) Requested Contrast Agent - 2C
  • (0040,0020) Scheduled Procedure Step Status - 3
  • (0040,0500) Scheduled Specimen Sequence - 3
  • (0040,0512) Container Identifier - 1
  • (0040,0518) Container Type Code Sequence - 2
  • (0040,0560) Specimen Description Sequence - 1
  • (0040,0551) Specimen Identifier - 1
  • (0040,0554) Specimen UID - 1
  • (2200,0005) Barcode Value - 3
  • (0040,1001) Requested Procedure ID - 1
  • (0032,1060) Requested Procedure Description - 1C
  • (0032,1064) Requested Procedure Code Sequence - 1C
  • (0032,1065) Requested Laterality Code Sequence - 3
  • (0020,000D) Study Instance UID - 1
  • (0008,0020) Study Date - 3
  • (0008,0030) Study Time - 3
  • (0008,1110) Referenced Study Sequence - 2
  • (0008,1150) Referenced SOP Class UID - 1
  • (0008,1155) Referenced SOP Instance UID - 1
  • (0040,1003) Requested Procedure Priority - 2
  • (0040,1004) Patient Transport Arrangements - 2
  • (0008,0050) Accession Number - 2
  • (0008,0051) Issuer of Accession Number Sequence - 3
  • (0032,1032) Requesting Physician - 2
  • (0008,0090) Referring Physician's Name - 2
  • (0038,0010) Admission ID - 2
  • (0038,0014) Issuer of Admission ID Sequence - 3
  • (0038,0300) Current Patient Location - 2
  • (0008,1120) Referenced Patient Sequence - 2
  • (0008,1150) Referenced SOP Class UID - 1
  • (0008,1155) Referenced SOP Instance UID - 1
  • (0010,0010) Patient's Name - 1
  • (0010,0020) Patient ID - 1
  • (0010,0021) Issuer of Patient ID - 3
  • (0010,0024) Issuer of Patient ID Qualifiers Sequence - 3
  • (0010,1002) Other Patient IDs Sequence - 3
  • (0010,0030) Patient's Birth Date - 2
  • (0010,0040) Patient's Sex - 2
  • (0010,0041) Gender Identity Sequence - 3
  • (0010,0044) Gender Identity Code Sequence - 1
  • (0040,A034) Effective Start DateTime - 3
  • (0040,A035) Effective Stop DateTime - 3
  • (0010,0045) Gender Identity Comment - 3
  • (0010,0043) Sex Parameters for Clinical Use Category Sequence - 3
  • (0010,0046) Sex Parameters for Clinical Use Category Code Sequence - 1
  • (0010,0042) Sex Parameters for Clinical Use Category Comment - 3
  • (0010,0047) Sex Parameters for Clinical Use Category Reference - 3
  • (0010,0011) Person Names to Use Sequence - 3
  • (0010,0012) Name to Use - 1
  • (0010,0013) Name to Use Comment - 3
  • (0010,0014) Third Person Pronouns Sequence - 3
  • (0010,0015) Pronoun Code Sequence - 1
  • (0010,0016) Pronoun Comment - 3
  • (0010,0101) Patient's Primary Language Code Sequence - 3
  • (0010,0102) Patient's Primary Language Modifier Code Sequence - 3
  • (0010,1030) Patient's Weight - 2
  • (0010,1020) Patient's Size - 3
  • (0040,3001) Confidentiality Constraint on Patient Data Description - 2
  • (0038,0500) Patient State - 2
  • (0010,21C0) Pregnancy Status - 2
  • (0010,2000) Medical Alerts - 2
  • (0010,2110) Allergies - 2
  • (0038,0050) Special Needs - 2
  • (0038,0100) Pertinent Documents Sequence - 3
  • (0008,1150) Referenced SOP Class UID - 1
  • (0008,1155) Referenced SOP Instance UID - 1
  • (0040,A170) Purpose of Reference Code Sequence - 2
  • (0042,0010) Document Title - 2
  1. Two direct download links for files of format .WL:
  1. Ghost blog embedded HTML JavaScript for drag and drop .WL file to dump properties:
.WL File Dumper

Drag and Drop .WL File

Drop .WL file here

(Note: This uses the dicom-parser library for decoding. Tags are formatted as hexadecimal strings without prefixes for use in the library.)

  1. Python class for .WL file:
import pydicom

class WLFile:
    def __init__(self, filename):
        self.ds = pydicom.dcmread(filename)
        self.properties = [
            {'tag': (0x0040, 0x0100), 'name': 'Scheduled Procedure Step Sequence', 'type': '1'},
            {'tag': (0x0040, 0x0001), 'name': 'Scheduled Station AE Title', 'type': '1'},
            {'tag': (0x0040, 0x0002), 'name': 'Scheduled Procedure Step Start Date', 'type': '1'},
            {'tag': (0x0040, 0x0003), 'name': 'Scheduled Procedure Step Start Time', 'type': '1'},
            {'tag': (0x0008, 0x0060), 'name': 'Modality', 'type': '1'},
            {'tag': (0x0040, 0x0006), 'name': 'Scheduled Performing Physician\'s Name', 'type': '2'},
            {'tag': (0x0040, 0x0007), 'name': 'Scheduled Procedure Step Description', 'type': '1C'},
            {'tag': (0x0040, 0x0010), 'name': 'Scheduled Station Name', 'type': '2'},
            {'tag': (0x0040, 0x0011), 'name': 'Scheduled Procedure Step Location', 'type': '2'},
            {'tag': (0x0018, 0x990C), 'name': 'Referenced Defined Protocol Sequence', 'type': '3'},
            {'tag': (0x0008, 0x1150), 'name': 'Referenced SOP Class UID', 'type': '1'},
            {'tag': (0x0008, 0x1155), 'name': 'Referenced SOP Instance UID', 'type': '1'},
            {'tag': (0x0018, 0x990D), 'name': 'Referenced Performed Protocol Sequence', 'type': '3'},
            {'tag': (0x0008, 0x1150), 'name': 'Referenced SOP Class UID', 'type': '1'},
            {'tag': (0x0008, 0x1155), 'name': 'Referenced SOP Instance UID', 'type': '1'},
            {'tag': (0x0040, 0x0008), 'name': 'Scheduled Protocol Code Sequence', 'type': '1C'},
            {'tag': (0x0040, 0x0440), 'name': 'Protocol Context Sequence', 'type': '3'},
            {'tag': (0x0040, 0xA040), 'name': 'Value Type', 'type': '1'},
            {'tag': (0x0040, 0xA043), 'name': 'Concept Name Code Sequence', 'type': '1'},
            {'tag': (0x0040, 0xA120), 'name': 'DateTime', 'type': '1C'},
            {'tag': (0x0040, 0xA123), 'name': 'Person Name', 'type': '1C'},
            {'tag': (0x0040, 0xA160), 'name': 'Text Value', 'type': '1C'},
            {'tag': (0x0040, 0xA168), 'name': 'Concept Code Sequence', 'type': '1C'},
            {'tag': (0x0040, 0xA30A), 'name': 'Numeric Value', 'type': '1C'},
            {'tag': (0x0040, 0x08EA), 'name': 'Measurement Units Code Sequence', 'type': '1C'},
            {'tag': (0x0040, 0x0012), 'name': 'Pre-Medication', 'type': '2C'},
            {'tag': (0x0040, 0x0009), 'name': 'Scheduled Procedure Step ID', 'type': '1'},
            {'tag': (0x0032, 0x1070), 'name': 'Requested Contrast Agent', 'type': '2C'},
            {'tag': (0x0040, 0x0020), 'name': 'Scheduled Procedure Step Status', 'type': '3'},
            {'tag': (0x0040, 0x0500), 'name': 'Scheduled Specimen Sequence', 'type': '3'},
            {'tag': (0x0040, 0x0512), 'name': 'Container Identifier', 'type': '1'},
            {'tag': (0x0040, 0x0518), 'name': 'Container Type Code Sequence', 'type': '2'},
            {'tag': (0x0040, 0x0560), 'name': 'Specimen Description Sequence', 'type': '1'},
            {'tag': (0x0040, 0x0551), 'name': 'Specimen Identifier', 'type': '1'},
            {'tag': (0x0040, 0x0554), 'name': 'Specimen UID', 'type': '1'},
            {'tag': (0x2200, 0x0005), 'name': 'Barcode Value', 'type': '3'},
            {'tag': (0x0040, 0x1001), 'name': 'Requested Procedure ID', 'type': '1'},
            {'tag': (0x0032, 0x1060), 'name': 'Requested Procedure Description', 'type': '1C'},
            {'tag': (0x0032, 0x1064), 'name': 'Requested Procedure Code Sequence', 'type': '1C'},
            {'tag': (0x0032, 0x1065), 'name': 'Requested Laterality Code Sequence', 'type': '3'},
            {'tag': (0x0020, 0x000D), 'name': 'Study Instance UID', 'type': '1'},
            {'tag': (0x0008, 0x0020), 'name': 'Study Date', 'type': '3'},
            {'tag': (0x0008, 0x0030), 'name': 'Study Time', 'type': '3'},
            {'tag': (0x0008, 0x1110), 'name': 'Referenced Study Sequence', 'type': '2'},
            {'tag': (0x0008, 0x1150), 'name': 'Referenced SOP Class UID', 'type': '1'},
            {'tag': (0x0008, 0x1155), 'name': 'Referenced SOP Instance UID', 'type': '1'},
            {'tag': (0x0040, 0x1003), 'name': 'Requested Procedure Priority', 'type': '2'},
            {'tag': (0x0040, 0x1004), 'name': 'Patient Transport Arrangements', 'type': '2'},
            {'tag': (0x0008, 0x0050), 'name': 'Accession Number', 'type': '2'},
            {'tag': (0x0008, 0x0051), 'name': 'Issuer of Accession Number Sequence', 'type': '3'},
            {'tag': (0x0032, 0x1032), 'name': 'Requesting Physician', 'type': '2'},
            {'tag': (0x0008, 0x0090), 'name': 'Referring Physician\'s Name', 'type': '2'},
            {'tag': (0x0038, 0x0010), 'name': 'Admission ID', 'type': '2'},
            {'tag': (0x0038, 0x0014), 'name': 'Issuer of Admission ID Sequence', 'type': '3'},
            {'tag': (0x0038, 0x0300), 'name': 'Current Patient Location', 'type': '2'},
            {'tag': (0x0008, 0x1120), 'name': 'Referenced Patient Sequence', 'type': '2'},
            {'tag': (0x0008, 0x1150), 'name': 'Referenced SOP Class UID', 'type': '1'},
            {'tag': (0x0008, 0x1155), 'name': 'Referenced SOP Instance UID', 'type': '1'},
            {'tag': (0x0010, 0x0010), 'name': 'Patient\'s Name', 'type': '1'},
            {'tag': (0x0010, 0x0020), 'name': 'Patient ID', 'type': '1'},
            {'tag': (0x0010, 0x0021), 'name': 'Issuer of Patient ID', 'type': '3'},
            {'tag': (0x0010, 0x0024), 'name': 'Issuer of Patient ID Qualifiers Sequence', 'type': '3'},
            {'tag': (0x0010, 0x1002), 'name': 'Other Patient IDs Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0030), 'name': 'Patient\'s Birth Date', 'type': '2'},
            {'tag': (0x0010, 0x0040), 'name': 'Patient\'s Sex', 'type': '2'},
            {'tag': (0x0010, 0x0041), 'name': 'Gender Identity Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0044), 'name': 'Gender Identity Code Sequence', 'type': '1'},
            {'tag': (0x0040, 0xA034), 'name': 'Effective Start DateTime', 'type': '3'},
            {'tag': (0x0040, 0xA035), 'name': 'Effective Stop DateTime', 'type': '3'},
            {'tag': (0x0010, 0x0045), 'name': 'Gender Identity Comment', 'type': '3'},
            {'tag': (0x0010, 0x0043), 'name': 'Sex Parameters for Clinical Use Category Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0046), 'name': 'Sex Parameters for Clinical Use Category Code Sequence', 'type': '1'},
            {'tag': (0x0010, 0x0042), 'name': 'Sex Parameters for Clinical Use Category Comment', 'type': '3'},
            {'tag': (0x0010, 0x0047), 'name': 'Sex Parameters for Clinical Use Category Reference', 'type': '3'},
            {'tag': (0x0010, 0x0011), 'name': 'Person Names to Use Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0012), 'name': 'Name to Use', 'type': '1'},
            {'tag': (0x0010, 0x0013), 'name': 'Name to Use Comment', 'type': '3'},
            {'tag': (0x0010, 0x0014), 'name': 'Third Person Pronouns Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0015), 'name': 'Pronoun Code Sequence', 'type': '1'},
            {'tag': (0x0010, 0x0016), 'name': 'Pronoun Comment', 'type': '3'},
            {'tag': (0x0010, 0x0101), 'name': 'Patient\'s Primary Language Code Sequence', 'type': '3'},
            {'tag': (0x0010, 0x0102), 'name': 'Patient\'s Primary Language Modifier Code Sequence', 'type': '3'},
            {'tag': (0x0010, 0x1030), 'name': 'Patient\'s Weight', 'type': '2'},
            {'tag': (0x0010, 0x1020), 'name': 'Patient\'s Size', 'type': '3'},
            {'tag': (0x0040, 0x3001), 'name': 'Confidentiality Constraint on Patient Data Description', 'type': '2'},
            {'tag': (0x0038, 0x0500), 'name': 'Patient State', 'type': '2'},
            {'tag': (0x0010, 0x21C0), 'name': 'Pregnancy Status', 'type': '2'},
            {'tag': (0x0010, 0x2000), 'name': 'Medical Alerts', 'type': '2'},
            {'tag': (0x0010, 0x2110), 'name': 'Allergies', 'type': '2'},
            {'tag': (0x0038, 0x0050), 'name': 'Special Needs', 'type': '2'},
            {'tag': (0x0038, 0x0100), 'name': 'Pertinent Documents Sequence', 'type': '3'},
            {'tag': (0x0008, 0x1150), 'name': 'Referenced SOP Class UID', 'type': '1'},
            {'tag': (0x0008, 0x1155), 'name': 'Referenced SOP Instance UID', 'type': '1'},
            {'tag': (0x0040, 0xA170), 'name': 'Purpose of Reference Code Sequence', 'type': '2'},
            {'tag': (0x0042, 0x0010), 'name': 'Document Title', 'type': '2'}
        ]

    def print_properties(self):
        for prop in self.properties:
            if prop['tag'] in self.ds:
                elem = self.ds[prop['tag']]
                print(f"{prop['name']} ({prop['tag']}): {elem.value}")

    def read_property(self, tag):
        return self.ds.get(tag)

    def write_property(self, tag, value):
        if tag in self.ds:
            self.ds[tag].value = value
        else:
            self.ds.add_new(tag, self.ds[tag].VR, value)  # Assumes VR known; adjust as needed.

    def save(self, filename):
        self.ds.save_as(filename)

(Note: Use WLFile('file.wl').print_properties() to print. Handles basic read/write; sequences may require recursive processing.)

  1. Java class for .WL file:
import org.dcm4che3.data.Attributes;
import org.dcm4che3.data.Tag;
import org.dcm4che3.data.VR;
import org.dcm4che3.io.DicomInputStream;
import org.dcm4che3.io.DicomOutputStream;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class WLFile {
    private Attributes ds;
    private Map<Integer, String> properties = new HashMap<>();  // tag -> name

    public WLFile(String filename) throws IOException {
        try (DicomInputStream dis = new DicomInputStream(new File(filename))) {
            ds = dis.readDataset();
        }
        // Populate properties (tag to name; type not stored here)
        properties.put(Tag.ScheduledProcedureStepSequence, "Scheduled Procedure Step Sequence");
        properties.put(Tag.ScheduledStationAETitle, "Scheduled Station AE Title");
        properties.put(Tag.ScheduledProcedureStepStartDate, "Scheduled Procedure Step Start Date");
        properties.put(Tag.ScheduledProcedureStepStartTime, "Scheduled Procedure Step Start Time");
        properties.put(Tag.Modality, "Modality");
        properties.put(Tag.ScheduledPerformingPhysiciansName, "Scheduled Performing Physician's Name");
        properties.put(Tag.ScheduledProcedureStepDescription, "Scheduled Procedure Step Description");
        properties.put(Tag.ScheduledStationName, "Scheduled Station Name");
        properties.put(Tag.ScheduledProcedureStepLocation, "Scheduled Procedure Step Location");
        properties.put(Tag.ReferencedDefinedProtocolSequence, "Referenced Defined Protocol Sequence");
        properties.put(Tag.ReferencedSOPClassUID, "Referenced SOP Class UID");
        properties.put(Tag.ReferencedSOPInstanceUID, "Referenced SOP Instance UID");
        properties.put(Tag.ReferencedPerformedProtocolSequence, "Referenced Performed Protocol Sequence");
        properties.put(Tag.ReferencedSOPClassUID, "Referenced SOP Class UID");
        properties.put(Tag.ReferencedSOPInstanceUID, "Referenced SOP Instance UID");
        properties.put(Tag.ScheduledProtocolCodeSequence, "Scheduled Protocol Code Sequence");
        properties.put(Tag.ProtocolContextSequence, "Protocol Context Sequence");
        properties.put(Tag.ValueType, "Value Type");
        properties.put(Tag.ConceptNameCodeSequence, "Concept Name Code Sequence");
        properties.put(Tag.DateTime, "DateTime");
        properties.put(Tag.PersonName, "Person Name");
        properties.put(Tag.TextValue, "Text Value");
        properties.put(Tag.ConceptCodeSequence, "Concept Code Sequence");
        properties.put(Tag.NumericValue, "Numeric Value");
        properties.put(Tag.MeasurementUnitsCodeSequence, "Measurement Units Code Sequence");
        properties.put(Tag.PreMedication, "Pre-Medication");
        properties.put(Tag.ScheduledProcedureStepID, "Scheduled Procedure Step ID");
        properties.put(Tag.RequestedContrastAgent, "Requested Contrast Agent");
        properties.put(Tag.ScheduledProcedureStepStatus, "Scheduled Procedure Step Status");
        properties.put(Tag.ScheduledSpecimenSequence, "Scheduled Specimen Sequence");
        properties.put(Tag.ContainerIdentifier, "Container Identifier");
        properties.put(Tag.ContainerTypeCodeSequence, "Container Type Code Sequence");
        properties.put(Tag.SpecimenDescriptionSequence, "Specimen Description Sequence");
        properties.put(Tag.SpecimenIdentifier, "Specimen Identifier");
        properties.put(Tag.SpecimenUID, "Specimen UID");
        properties.put(Tag.BarcodeValue, "Barcode Value");
        properties.put(Tag.RequestedProcedureID, "Requested Procedure ID");
        properties.put(Tag.RequestedProcedureDescription, "Requested Procedure Description");
        properties.put(Tag.RequestedProcedureCodeSequence, "Requested Procedure Code Sequence");
        properties.put(Tag.RequestedLateralityCodeSequence, "Requested Laterality Code Sequence");
        properties.put(Tag.StudyInstanceUID, "Study Instance UID");
        properties.put(Tag.StudyDate, "Study Date");
        properties.put(Tag.StudyTime, "Study Time");
        properties.put(Tag.ReferencedStudySequence, "Referenced Study Sequence");
        properties.put(Tag.ReferencedSOPClassUID, "Referenced SOP Class UID");
        properties.put(Tag.ReferencedSOPInstanceUID, "Referenced SOP Instance UID");
        properties.put(Tag.RequestedProcedurePriority, "Requested Procedure Priority");
        properties.put(Tag.PatientTransportArrangements, "Patient Transport Arrangements");
        properties.put(Tag.AccessionNumber, "Accession Number");
        properties.put(Tag.IssuerOfAccessionNumberSequence, "Issuer of Accession Number Sequence");
        properties.put(Tag.RequestingPhysician, "Requesting Physician");
        properties.put(Tag.ReferringPhysiciansName, "Referring Physician's Name");
        properties.put(Tag.AdmissionID, "Admission ID");
        properties.put(Tag.IssuerOfAdmissionIDSequence, "Issuer of Admission ID Sequence");
        properties.put(Tag.CurrentPatientLocation, "Current Patient Location");
        properties.put(Tag.ReferencedPatientSequence, "Referenced Patient Sequence");
        properties.put(Tag.ReferencedSOPClassUID, "Referenced SOP Class UID");
        properties.put(Tag.ReferencedSOPInstanceUID, "Referenced SOP Instance UID");
        properties.put(Tag.PatientName, "Patient's Name");
        properties.put(Tag.PatientID, "Patient ID");
        properties.put(Tag.IssuerOfPatientID, "Issuer of Patient ID");
        properties.put(Tag.IssuerOfPatientIDQualifiersSequence, "Issuer of Patient ID Qualifiers Sequence");
        properties.put(Tag.OtherPatientIDsSequence, "Other Patient IDs Sequence");
        properties.put(Tag.PatientBirthDate, "Patient's Birth Date");
        properties.put(Tag.PatientSex, "Patient's Sex");
        properties.put(Tag.GenderIdentitySequence, "Gender Identity Sequence");
        properties.put(Tag.GenderIdentityCodeSequence, "Gender Identity Code Sequence");
        properties.put(Tag.EffectiveStartDateTime, "Effective Start DateTime");
        properties.put(Tag.EffectiveStopDateTime, "Effective Stop DateTime");
        properties.put(Tag.GenderIdentityComment, "Gender Identity Comment");
        properties.put(Tag.SexParametersForClinicalUseCategorySequence, "Sex Parameters for Clinical Use Category Sequence");
        properties.put(Tag.SexParametersForClinicalUseCategoryCodeSequence, "Sex Parameters for Clinical Use Category Code Sequence");
        properties.put(Tag.SexParametersForClinicalUseCategoryComment, "Sex Parameters for Clinical Use Category Comment");
        properties.put(Tag.SexParametersForClinicalUseCategoryReference, "Sex Parameters for Clinical Use Category Reference");
        properties.put(Tag.PersonNamesToUseSequence, "Person Names to Use Sequence");
        properties.put(Tag.NameToUse, "Name to Use");
        properties.put(Tag.NameToUseComment, "Name to Use Comment");
        properties.put(Tag.ThirdPersonPronounsSequence, "Third Person Pronouns Sequence");
        properties.put(Tag.PronounCodeSequence, "Pronoun Code Sequence");
        properties.put(Tag.PronounComment, "Pronoun Comment");
        properties.put(Tag.PatientsPrimaryLanguageCodeSequence, "Patient's Primary Language Code Sequence");
        properties.put(Tag.PatientsPrimaryLanguageModifierCodeSequence, "Patient's Primary Language Modifier Code Sequence");
        properties.put(Tag.PatientWeight, "Patient's Weight");
        properties.put(Tag.PatientSize, "Patient's Size");
        properties.put(Tag.ConfidentialityConstraintOnPatientDataDescription, "Confidentiality Constraint on Patient Data Description");
        properties.put(Tag.PatientState, "Patient State");
        properties.put(Tag.PregnancyStatus, "Pregnancy Status");
        properties.put(Tag.MedicalAlerts, "Medical Alerts");
        properties.put(Tag.Allergies, "Allergies");
        properties.put(Tag.SpecialNeeds, "Special Needs");
        properties.put(Tag.PertinentDocumentsSequence, "Pertinent Documents Sequence");
        properties.put(Tag.ReferencedSOPClassUID, "Referenced SOP Class UID");
        properties.put(Tag.ReferencedSOPInstanceUID, "Referenced SOP Instance UID");
        properties.put(Tag.PurposeOfReferenceCodeSequence, "Purpose of Reference Code Sequence");
        properties.put(Tag.DocumentTitle, "Document Title");
    }

    public void printProperties() {
        for (Map.Entry<Integer, String> entry : properties.entrySet()) {
            int tag = entry.getKey();
            if (ds.contains(tag)) {
                System.out.println(entry.getValue() + " (" + Integer.toHexString(tag) + "): " + ds.getString(tag));
            }
        }
    }

    public String readProperty(int tag) {
        return ds.getString(tag);
    }

    public void writeProperty(int tag, String value) {
        ds.setString(tag, VR.PN, value);  // Example for PN VR; adjust VR per tag.
    }

    public void save(String filename) throws IOException {
        try (DicomOutputStream dos = new DicomOutputStream(new File(filename))) {
            dos.writeDataset(ds.createFileMetaInformation("1.2.840.10008.1.2.1"), ds);
        }
    }
}

(Note: Requires dcm4che3 library. Handles basic read/write; sequences may need recursive handling. Tags use dcm4che Tag constants.)

  1. JavaScript class for .WL file:
const dicomParser = require('dicom-parser');  // npm install dicom-parser
const fs = require('fs');  // For Node.js

class WLFile {
    constructor(filename) {
        const byteArray = fs.readFileSync(filename);
        this.ds = dicomParser.parseDicom(byteArray);
        this.properties = [
            {tag: 'x00400100', name: 'Scheduled Procedure Step Sequence', type: '1'},
            {tag: 'x00400001', name: 'Scheduled Station AE Title', type: '1'},
            {tag: 'x00400002', name: 'Scheduled Procedure Step Start Date', type: '1'},
            {tag: 'x00400003', name: 'Scheduled Procedure Step Start Time', type: '1'},
            {tag: 'x00080060', name: 'Modality', type: '1'},
            {tag: 'x00400006', name: 'Scheduled Performing Physician\'s Name', type: '2'},
            {tag: 'x00400007', name: 'Scheduled Procedure Step Description', type: '1C'},
            {tag: 'x00400010', name: 'Scheduled Station Name', type: '2'},
            {tag: 'x00400011', name: 'Scheduled Procedure Step Location', type: '2'},
            {tag: 'x0018990C', name: 'Referenced Defined Protocol Sequence', type: '3'},
            {tag: 'x00081150', name: 'Referenced SOP Class UID', type: '1'},
            {tag: 'x00081155', name: 'Referenced SOP Instance UID', type: '1'},
            {tag: 'x0018990D', name: 'Referenced Performed Protocol Sequence', type: '3'},
            {tag: 'x00081150', name: 'Referenced SOP Class UID', type: '1'},
            {tag: 'x00081155', name: 'Referenced SOP Instance UID', type: '1'},
            {tag: 'x00400008', name: 'Scheduled Protocol Code Sequence', type: '1C'},
            {tag: 'x00400440', name: 'Protocol Context Sequence', type: '3'},
            {tag: 'x0040A040', name: 'Value Type', type: '1'},
            {tag: 'x0040A043', name: 'Concept Name Code Sequence', type: '1'},
            {tag: 'x0040A120', name: 'DateTime', type: '1C'},
            {tag: 'x0040A123', name: 'Person Name', type: '1C'},
            {tag: 'x0040A160', name: 'Text Value', type: '1C'},
            {tag: 'x0040A168', name: 'Concept Code Sequence', type: '1C'},
            {tag: 'x0040A30A', name: 'Numeric Value', type: '1C'},
            {tag: 'x004008EA', name: 'Measurement Units Code Sequence', type: '1C'},
            {tag: 'x00400012', name: 'Pre-Medication', type: '2C'},
            {tag: 'x00400009', name: 'Scheduled Procedure Step ID', type: '1'},
            {tag: 'x00321070', name: 'Requested Contrast Agent', type: '2C'},
            {tag: 'x00400020', name: 'Scheduled Procedure Step Status', type: '3'},
            {tag: 'x00400500', name: 'Scheduled Specimen Sequence', type: '3'},
            {tag: 'x00400512', name: 'Container Identifier', type: '1'},
            {tag: 'x00400518', name: 'Container Type Code Sequence', type: '2'},
            {tag: 'x00400560', name: 'Specimen Description Sequence', type: '1'},
            {tag: 'x00400551', name: 'Specimen Identifier', type: '1'},
            {tag: 'x00400554', name: 'Specimen UID', type: '1'},
            {tag: 'x22000005', name: 'Barcode Value', type: '3'},
            {tag: 'x00401001', name: 'Requested Procedure ID', type: '1'},
            {tag: 'x00321060', name: 'Requested Procedure Description', type: '1C'},
            {tag: 'x00321064', name: 'Requested Procedure Code Sequence', type: '1C'},
            {tag: 'x00321065', name: 'Requested Laterality Code Sequence', type: '3'},
            {tag: 'x0020000D', name: 'Study Instance UID', type: '1'},
            {tag: 'x00080020', name: 'Study Date', type: '3'},
            {tag: 'x00080030', name: 'Study Time', type: '3'},
            {tag: 'x00081110', name: 'Referenced Study Sequence', type: '2'},
            {tag: 'x00081150', name: 'Referenced SOP Class UID', type: '1'},
            {tag: 'x00081155', name: 'Referenced SOP Instance UID', type: '1'},
            {tag: 'x00401003', name: 'Requested Procedure Priority', type: '2'},
            {tag: 'x00401004', name: 'Patient Transport Arrangements', type: '2'},
            {tag: 'x00080050', name: 'Accession Number', type: '2'},
            {tag: 'x00080051', name: 'Issuer of Accession Number Sequence', type: '3'},
            {tag: 'x00321032', name: 'Requesting Physician', type: '2'},
            {tag: 'x00080090', name: 'Referring Physician\'s Name', type: '2'},
            {tag: 'x00380010', name: 'Admission ID', type: '2'},
            {tag: 'x00380014', name: 'Issuer of Admission ID Sequence', type: '3'},
            {tag: 'x00380300', name: 'Current Patient Location', type: '2'},
            {tag: 'x00081120', name: 'Referenced Patient Sequence', type: '2'},
            {tag: 'x00081150', name: 'Referenced SOP Class UID', type: '1'},
            {tag: 'x00081155', name: 'Referenced SOP Instance UID', type: '1'},
            {tag: 'x00100010', name: 'Patient\'s Name', type: '1'},
            {tag: 'x00100020', name: 'Patient ID', type: '1'},
            {tag: 'x00100021', name: 'Issuer of Patient ID', type: '3'},
            {tag: 'x00100024', name: 'Issuer of Patient ID Qualifiers Sequence', type: '3'},
            {tag: 'x00101002', name: 'Other Patient IDs Sequence', type: '3'},
            {tag: 'x00100030', name: 'Patient\'s Birth Date', type: '2'},
            {tag: 'x00100040', name: 'Patient\'s Sex', type: '2'},
            {tag: 'x00100041', name: 'Gender Identity Sequence', type: '3'},
            {tag: 'x00100044', name: 'Gender Identity Code Sequence', type: '1'},
            {tag: 'x0040A034', name: 'Effective Start DateTime', type: '3'},
            {tag: 'x0040A035', name: 'Effective Stop DateTime', type: '3'},
            {tag: 'x00100045', name: 'Gender Identity Comment', type: '3'},
            {tag: 'x00100043', name: 'Sex Parameters for Clinical Use Category Sequence', type: '3'},
            {tag: 'x00100046', name: 'Sex Parameters for Clinical Use Category Code Sequence', type: '1'},
            {tag: 'x00100042', name: 'Sex Parameters for Clinical Use Category Comment', type: '3'},
            {tag: 'x00100047', name: 'Sex Parameters for Clinical Use Category Reference', type: '3'},
            {tag: 'x00100011', name: 'Person Names to Use Sequence', type: '3'},
            {tag: 'x00100012', name: 'Name to Use', type: '1'},
            {tag: 'x00100013', name: 'Name to Use Comment', type: '3'},
            {tag: 'x00100014', name: 'Third Person Pronouns Sequence', type: '3'},
            {tag: 'x00100015', name: 'Pronoun Code Sequence', type: '1'},
            {tag: 'x00100016', name: 'Pronoun Comment', type: '3'},
            {tag: 'x00100101', name: 'Patient\'s Primary Language Code Sequence', type: '3'},
            {tag: 'x00100102', name: 'Patient\'s Primary Language Modifier Code Sequence', type: '3'},
            {tag: 'x00101030', name: 'Patient\'s Weight', type: '2'},
            {tag: 'x00101020', name: 'Patient\'s Size', type: '3'},
            {tag: 'x00403001', name: 'Confidentiality Constraint on Patient Data Description', type: '2'},
            {tag: 'x00380500', name: 'Patient State', type: '2'},
            {tag: 'x001021C0', name: 'Pregnancy Status', type: '2'},
            {tag: 'x00102000', name: 'Medical Alerts', type: '2'},
            {tag: 'x00102110', name: 'Allergies', type: '2'},
            {tag: 'x00380050', name: 'Special Needs', type: '2'},
            {tag: 'x00380100', name: 'Pertinent Documents Sequence', type: '3'},
            {tag: 'x00081150', name: 'Referenced SOP Class UID', type: '1'},
            {tag: 'x00081155', name: 'Referenced SOP Instance UID', type: '1'},
            {tag: 'x0040A170', name: 'Purpose of Reference Code Sequence', type: '2'},
            {tag: 'x00420010', name: 'Document Title', type: '2'}
        ];
    }

    printProperties() {
        let output = '';
        this.properties.forEach(prop => {
            const element = this.ds.elements[prop.tag];
            if (element) {
                const value = this.ds.string(prop.tag) || '[Binary/Sequence]';
                output += `${prop.name} (${prop.tag.slice(1)}): ${value}\n`;
            }
        });
        console.log(output);
    }

    // Read: return value for tag (string assumed)
    readProperty(tag) {
        return this.ds.string('x' + tag);
    }

    // Write: basic, but DICOM write in JS is limited; use for read-only or extend with dicom-writer if needed
    writeProperty(tag, value) {
        console.warn('Write not fully implemented; JS DICOM write requires additional libs.');
        // Placeholder: modify in-memory, but saving needs serialization.
    }

    save(filename) {
        console.warn('Save not implemented; use external tool for full write.');
    }
}

(Note: For Node.js. Write/save is partial due to JavaScript limitations; suitable primarily for dumping.)

  1. C class (using C++ for class support, with DCMTK library):
#include <dcmtk/dcmdata/dcdatset.h>
#include <dcmtk/dcmdata/dcfilefo.h>
#include <dcmtk/dcmdata/dctk.h>
#include <iostream>
#include <vector>
#include <string>

struct Property {
    Uint32 tag;
    std::string name;
    std::string type;
};

class WLFile {
private:
    DcmFileFormat fileformat;
    std::vector<Property> properties;

public:
    WLFile(const std::string& filename) {
        OFCondition status = fileformat.loadFile(filename.c_str());
        if (!status.good()) {
            std::cerr << "Error loading file" << std::endl;
        }
        // Populate properties
        properties.push_back({DCM_ScheduledProcedureStepSequence, "Scheduled Procedure Step Sequence", "1"});
        properties.push_back({DCM_ScheduledStationAETitle, "Scheduled Station AE Title", "1"});
        properties.push_back({DCM_ScheduledProcedureStepStartDate, "Scheduled Procedure Step Start Date", "1"});
        properties.push_back({DCM_ScheduledProcedureStepStartTime, "Scheduled Procedure Step Start Time", "1"});
        properties.push_back({DCM_Modality, "Modality", "1"});
        properties.push_back({DCM_ScheduledPerformingPhysiciansName, "Scheduled Performing Physician's Name", "2"});
        properties.push_back({DCM_ScheduledProcedureStepDescription, "Scheduled Procedure Step Description", "1C"});
        properties.push_back({DCM_ScheduledStationName, "Scheduled Station Name", "2"});
        properties.push_back({DCM_ScheduledProcedureStepLocation, "Scheduled Procedure Step Location", "2"});
        properties.push_back({DCM_ReferencedDefinedProtocolSequence, "Referenced Defined Protocol Sequence", "3"});
        properties.push_back({DCM_ReferencedSOPClassUID, "Referenced SOP Class UID", "1"});
        properties.push_back({DCM_ReferencedSOPInstanceUID, "Referenced SOP Instance UID", "1"});
        properties.push_back({DCM_ReferencedPerformedProtocolSequence, "Referenced Performed Protocol Sequence", "3"});
        properties.push_back({DCM_ReferencedSOPClassUID, "Referenced SOP Class UID", "1"});
        properties.push_back({DCM_ReferencedSOPInstanceUID, "Referenced SOP Instance UID", "1"});
        properties.push_back({DCM_ScheduledProtocolCodeSequence, "Scheduled Protocol Code Sequence", "1C"});
        properties.push_back({DCM_ProtocolContextSequence, "Protocol Context Sequence", "3"});
        properties.push_back({DCM_ValueType, "Value Type", "1"});
        properties.push_back({DCM_ConceptNameCodeSequence, "Concept Name Code Sequence", "1"});
        properties.push_back({DCM_DateTime, "DateTime", "1C"});
        properties.push_back({DCM_PersonName, "Person Name", "1C"});
        properties.push_back({DCM_TextValue, "Text Value", "1C"});
        properties.push_back({DCM_ConceptCodeSequence, "Concept Code Sequence", "1C"});
        properties.push_back({DCM_NumericValue, "Numeric Value", "1C"});
        properties.push_back({DCM_MeasurementUnitsCodeSequence, "Measurement Units Code Sequence", "1C"});
        properties.push_back({DCM_PreMedication, "Pre-Medication", "2C"});
        properties.push_back({DCM_ScheduledProcedureStepID, "Scheduled Procedure Step ID", "1"});
        properties.push_back({DCM_RequestedContrastAgent, "Requested Contrast Agent", "2C"});
        properties.push_back({DCM_ScheduledProcedureStepStatus, "Scheduled Procedure Step Status", "3"});
        properties.push_back({DCM_ScheduledSpecimenSequence, "Scheduled Specimen Sequence", "3"});
        properties.push_back({DCM_ContainerIdentifier, "Container Identifier", "1"});
        properties.push_back({DCM_ContainerTypeCodeSequence, "Container Type Code Sequence", "2"});
        properties.push_back({DCM_SpecimenDescriptionSequence, "Specimen Description Sequence", "1"});
        properties.push_back({DCM_SpecimenIdentifier, "Specimen Identifier", "1"});
        properties.push_back({DCM_SpecimenUID, "Specimen UID", "1"});
        properties.push_back({DCM_BarcodeValue, "Barcode Value", "3"});
        properties.push_back({DCM_RequestedProcedureID, "Requested Procedure ID", "1"});
        properties.push_back({DCM_RequestedProcedureDescription, "Requested Procedure Description", "1C"});
        properties.push_back({DCM_RequestedProcedureCodeSequence, "Requested Procedure Code Sequence", "1C"});
        properties.push_back({DCM_RequestedLateralityCodeSequence, "Requested Laterality Code Sequence", "3"});
        properties.push_back({DCM_StudyInstanceUID, "Study Instance UID", "1"});
        properties.push_back({DCM_StudyDate, "Study Date", "3"});
        properties.push_back({DCM_StudyTime, "Study Time", "3"});
        properties.push_back({DCM_ReferencedStudySequence, "Referenced Study Sequence", "2"});
        properties.push_back({DCM_ReferencedSOPClassUID, "Referenced SOP Class UID", "1"});
        properties.push_back({DCM_ReferencedSOPInstanceUID, "Referenced SOP Instance UID", "1"});
        properties.push_back({DCM_RequestedProcedurePriority, "Requested Procedure Priority", "2"});
        properties.push_back({DCM_PatientTransportArrangements, "Patient Transport Arrangements", "2"});
        properties.push_back({DCM_AccessionNumber, "Accession Number", "2"});
        properties.push_back({DCM_IssuerOfAccessionNumberSequence, "Issuer of Accession Number Sequence", "3"});
        properties.push_back({DCM_RequestingPhysician, "Requesting Physician", "2"});
        properties.push_back({DCM_ReferringPhysiciansName, "Referring Physician's Name", "2"});
        properties.push_back({DCM_AdmissionID, "Admission ID", "2"});
        properties.push_back({DCM_IssuerOfAdmissionIDSequence, "Issuer of Admission ID Sequence", "3"});
        properties.push_back({DCM_CurrentPatientLocation, "Current Patient Location", "2"});
        properties.push_back({DCM_ReferencedPatientSequence, "Referenced Patient Sequence", "2"});
        properties.push_back({DCM_ReferencedSOPClassUID, "Referenced SOP Class UID", "1"});
        properties.push_back({DCM_ReferencedSOPInstanceUID, "Referenced SOP Instance UID", "1"});
        properties.push_back({DCM_PatientName, "Patient's Name", "1"});
        properties.push_back({DCM_PatientID, "Patient ID", "1"});
        properties.push_back({DCM_IssuerOfPatientID, "Issuer of Patient ID", "3"});
        properties.push_back({DCM_IssuerOfPatientIDQualifiersSequence, "Issuer of Patient ID Qualifiers Sequence", "3"});
        properties.push_back({DCM_OtherPatientIDsSequence, "Other Patient IDs Sequence", "3"});
        properties.push_back({DCM_PatientBirthDate, "Patient's Birth Date", "2"});
        properties.push_back({DCM_PatientSex, "Patient's Sex", "2"});
        properties.push_back({DCM_GenderIdentitySequence, "Gender Identity Sequence", "3"});
        properties.push_back({DCM_GenderIdentityCodeSequence, "Gender Identity Code Sequence", "1"});
        properties.push_back({DCM_EffectiveStartDateTime, "Effective Start DateTime", "3"});
        properties.push_back({DCM_EffectiveStopDateTime, "Effective Stop DateTime", "3"});
        properties.push_back({DCM_GenderIdentityComment, "Gender Identity Comment", "3"});
        properties.push_back({DCM_SexParametersForClinicalUseCategorySequence, "Sex Parameters for Clinical Use Category Sequence", "3"});
        properties.push_back({DCM_SexParametersForClinicalUseCategoryCodeSequence, "Sex Parameters for Clinical Use Category Code Sequence", "1"});
        properties.push_back({DCM_SexParametersForClinicalUseCategoryComment, "Sex Parameters for Clinical Use Category Comment", "3"});
        properties.push_back({DCM_SexParametersForClinicalUseCategoryReference, "Sex Parameters for Clinical Use Category Reference", "3"});
        properties.push_back({DCM_PersonNamesToUseSequence, "Person Names to Use Sequence", "3"});
        properties.push_back({DCM_NameToUse, "Name to Use", "1"});
        properties.push_back({DCM_NameToUseComment, "Name to Use Comment", "3"});
        properties.push_back({DCM_ThirdPersonPronounsSequence, "Third Person Pronouns Sequence", "3"});
        properties.push_back({DCM_PronounCodeSequence, "Pronoun Code Sequence", "1"});
        properties.push_back({DCM_PronounComment, "Pronoun Comment", "3"});
        properties.push_back({DCM_PatientsPrimaryLanguageCodeSequence, "Patient's Primary Language Code Sequence", "3"});
        properties.push_back({DCM_PatientsPrimaryLanguageModifierCodeSequence, "Patient's Primary Language Modifier Code Sequence", "3"});
        properties.push_back({DCM_PatientWeight, "Patient's Weight", "2"});
        properties.push_back({DCM_PatientSize, "Patient's Size", "3"});
        properties.push_back({DCM_ConfidentialityConstraintOnPatientDataDescription, "Confidentiality Constraint on Patient Data Description", "2"});
        properties.push_back({DCM_PatientState, "Patient State", "2"});
        properties.push_back({DCM_PregnancyStatus, "Pregnancy Status", "2"});
        properties.push_back({DCM_MedicalAlerts, "Medical Alerts", "2"});
        properties.push_back({DCM_Allergies, "Allergies", "2"});
        properties.push_back({DCM_SpecialNeeds, "Special Needs", "2"});
        properties.push_back({DCM_PertinentDocumentsSequence, "Pertinent Documents Sequence", "3"});
        properties.push_back({DCM_ReferencedSOPClassUID, "Referenced SOP Class UID", "1"});
        properties.push_back({DCM_ReferencedSOPInstanceUID, "Referenced SOP Instance UID", "1"});
        properties.push_back({DCM_PurposeOfReferenceCodeSequence, "Purpose of Reference Code Sequence", "2"});
        properties.push_back({DCM_DocumentTitle, "Document Title", "2"});
    }

    void printProperties() {
        DcmDataset *ds = fileformat.getDataset();
        for (const auto& prop : properties) {
            OFString value;
            if (ds->findAndGetOFStringArray(prop.tag, value).good()) {
                std::cout << prop.name << " (" << std::hex << prop.tag << "): " << value << std::endl;
            }
        }
    }

    OFString readProperty(Uint32 tag) {
        OFString value;
        fileformat.getDataset()->findAndGetOFStringArray(tag, value);
        return value;
    }

    void writeProperty(Uint32 tag, const std::string& value) {
        fileformat.getDataset()->putAndInsertString(tag, value.c_str());
    }

    void save(const std::string& filename) {
        fileformat.saveFile(filename.c_str(), EXS_LittleEndianExplicit);
    }
};

(Note: Requires DCMTK library. Use like WLFile wl("file.wl"); wl.printProperties();. Tags use DCMTK DCM_ macros.)