```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:query_definition xmlns:ns2="http://www.i2b2.org/xsd/cell/crc/psm/1.1/" xmlns:ns4="http://www.i2b2.org/xsd/cell/crc/psm/querydefinition/1.1/" xmlns:ns3="http://www.i2b2.org/xsd/cell/crc/psm/analysisdefinition/1.1/">
    <query_name>Principal Diagn@19:04:57</query_name>
    <query_timing>ANY</query_timing>
    <specificity_scale>0</specificity_scale>
    <panel>
        <panel_number>1</panel_number>
        <panel_timing>ANY</panel_timing>
        <panel_accuracy_scale>100</panel_accuracy_scale>
        <invert>0</invert>
        <total_item_occurrences>1</total_item_occurrences>
        <item>
            <hlevel>5</hlevel>
            <item_name>Diabetes mellitus with hyperosmolarity</item_name>
            <item_key>\\i2b2_DIAG\i2b2\Diagnoses\Endocrine disorders (240-259)\Other endocrine gland diseases (250-259)\(250) Diabetes mellitus\(250-2) Diabetes mellitus with hy~\</item_key>
            <item_icon>FA</item_icon>
            <tooltip>Diagnoses \ Endocrine disorders \ Other endocrine gland diseases \ Diabetes mellitus \ Diabetes mellitus with hyperosmolarity</tooltip>
            <class>ENC</class>
            <constrain_by_modifier>
                <modifier_name>Principal Diagnosis</modifier_name>
                <modifier_key>\\i2b2_DIAG\Principal Diagnosis\</modifier_key>
                <applied_path>\i2b2\Diagnoses\Endocrine disorders (240-259)\%</applied_path>
            </constrain_by_modifier>
            <item_is_synonym>false</item_is_synonym>
        </item>
    </panel>
</ns4:query_definition>

```

I want to find all instances of "Diabetes mellitus with hyperosmolarity" as a principal diagnosis within the Endocrine disorders category of the i2b2 Diagnoses ontology. This query will return cases where this condition has been identified as the primary diagnosis for a patient, and the search will be performed with a specificity scale of 0 and an accuracy scale of 100, with a single item occurrence. The query will be applied to any time frame, and the results will not be inverted. The icon for this item will be FA, and the tooltip will display the full path to the diagnosis: Diagnoses > Endocrine disorders > Other endocrine gland diseases > Diabetes mellitus > Diabetes mellitus with hyperosmolarity.