archetype (adl_version=1.4)
    openEHR-EHR-OBSERVATION.laboratory.v1

concept
    [at0000]    -- Laboratory result
language
    original_language = <[ISO_639-1::en]>
description
    original_author = <
        ["name"] = <"unknown">
    >
    details = <
        ["en"] = <
            language = <[ISO_639-1::en]>
            purpose = <"Generic entry to contain a laboratory report. This allows a terminology driven approach using LOINC codes to specify the name of the elements and the value types are set at runtime.">
            use = <"">
            keywords = <"labs", "pathology", "biochemistry", "laboratory">
            misuse = <"">
        >
    >
    lifecycle_state = <"Initial">
    other_contributors = <>

definition
    OBSERVATION[at0000]  {    -- Laboratory result
        data  {
            HISTORY[at0001]  {    -- history
                events cardinality  {1..*; unordered}  {
                    EVENT[at0002] occurrences  {0..*}  {    -- Any event
                        data  {
                            ITEM_TREE[at0003]  {    -- Tree
                                items cardinality  {0..*; ordered}  {
                                    CLUSTER[at0004]  {    -- Specimen
                                        items cardinality  {1..*; ordered}  {
                                            ELEMENT[at0006] occurrences  {0..1}  {    -- Description
                                                value  {
                                                    DV_TEXT  {*}
                                                }
                                            }
                                            ELEMENT[at0007] occurrences  {0..*}  {    -- Body site
                                                value  {
                                                    DV_TEXT  {*}
                                                }
                                            }
                                        }
                                    }
                                    ELEMENT[at0008] occurrences  {0..1}  {    -- Diagnostic service
                                        value  {
                                            DV_CODED_TEXT  {
                                                defining_code  {
                                                    [local::
                                                    at0009,     -- Chemistry
                                                    at0010]    -- Microbiology
                                                }
                                            }
                                        }
                                    }
                                    CLUSTER[at0011] occurrences  {0..*}  {    -- level 1
                                        name  {
                                            DV_CODED_TEXT  {
                                                defining_code  {[ac0000]}        -- =LOINC::Battery_name
                                            }
                                        }
                                        items cardinality  {0..*; unordered}  {
                                            CLUSTER[at0012] occurrences  {0..*}  {    -- level 2
                                                name  {
                                                    DV_CODED_TEXT  {
                                                        defining_code  {[ac0001]}        -- =LOINC::Battery_name
                                                    }
                                                }
                                                items cardinality  {0..*; unordered}  {
                                                    use_node ELEMENT /data[at0001]/events[at0002]/data[at0003]/items[at0013]
                                                }
                                            }
                                            use_node ELEMENT /data[at0001]/events[at0002]/data[at0003]/items[at0013]
                                        }
                                    }
                                    ELEMENT[at0013] occurrences  {0..*}  {*}
                                    CLUSTER[at0014] occurrences  {0..*}  {    -- Comment
                                        items cardinality  {2..*; ordered}  {
                                            ELEMENT[at0015]  {    -- Path
                                                value  {
                                                    DV_URI  {*}
                                                }
                                            }
                                            ELEMENT[at0016]  {    -- Comment
                                                value  {
                                                    DV_TEXT  {*}
                                                }
                                            }
                                        }
                                    }
                                    ELEMENT[at0017] occurrences  {0..1}  {    -- Overall Comment
                                        value  {
                                            DV_TEXT  {*}
                                        }
                                    }
                                    CLUSTER[at0018] occurrences  {0..1}  {    -- Quality
                                        items cardinality  {1..*; unordered}  {
                                            CLUSTER[at0019] occurrences  {0..*}  {    -- Specimen
                                                items cardinality  {0..*; unordered}  {
                                                    ELEMENT[at0020]  {    -- Issue
                                                        value  {
                                                            DV_CODED_TEXT  {
                                                                defining_code  {
                                                                    [local::
                                                                    at0021,     -- Haemolysed
                                                                    at0022,     -- Lipaemic
                                                                    at0023,     -- Incorrect preservative
                                                                    at0024]    -- Insufficient sample
                                                                }
                                                            }
                                                        }
                                                    }
                                                    ELEMENT[at0025] occurrences  {0..1}  {    -- Rating
                                                        value  {
                                                            DV_COUNT  {
                                                                magnitude  {|0..10|}
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            CLUSTER[at0026] occurrences  {0..1}  {    -- Handling
                                                items cardinality  {0..*; unordered}  {
                                                    ELEMENT[at0027] occurrences  {0..*}  {    -- Issue
                                                        value  {
                                                            DV_CODED_TEXT  {
                                                                defining_code  {
                                                                    [local::
                                                                    at0028,     -- Handling error
                                                                    at0029,     -- Age
                                                                    at0030,     -- Laboratory accident
                                                                    at0031]    -- Fail
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            ELEMENT[at0032] occurrences  {0..1}  {    -- Description
                                                value  {
                                                    DV_TEXT  {*}
                                                }
                                            }
                                        }
                                    }
                                    ELEMENT[at0037] occurrences  {0..1}  {    -- Multimedia representation
                                        value  {
                                            DV_MULTIMEDIA  {
                                                media_type  {
                                                    [openEHR::
                                                    425, 
                                                    426, 
                                                    427, 
                                                    428, 
                                                    429, 
                                                    417, 
                                                    418, 
                                                    419, 
                                                    420, 
                                                    421, 
                                                    422, 
                                                    423, 
                                                    424]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        protocol  {
            ITEM_TREE[at0033]  {    -- Tree
                items cardinality  {0..*; ordered}  {
                    CLUSTER[at0034] occurrences  {0..1}  {    -- Identification
                        items cardinality  {0..*; ordered}  {
                            ELEMENT[at0035] occurrences  {0..1}  {    -- Specimen identification
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                            ELEMENT[at0036] occurrences  {0..1}  {    -- Laboratory
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                        }
                    }
                    CLUSTER[at0039] occurrences  {0..1}  {    -- Specimen details
                        items cardinality  {0..*; unordered}  {
                            ELEMENT[at0040] occurrences  {0..1}  {    -- DateTime received
                                value  {
                                    DV_DATE_TIME  {
                                        value  {yyyy-??-??T??:??:??}
                                    }
                                }
                            }
                            ELEMENT[at0041] occurrences  {0..1}  {    -- DateTime processed
                                value  {
                                    DV_DATE_TIME  {
                                        value  {yyyy-??-??T??:??:??}
                                    }
                                }
                            }
                        }
                    }
                    CLUSTER[at0042] occurrences  {0..1}  {    -- Methods
                        items cardinality  {0..*; unordered}  {
                            ELEMENT[at0038] occurrences  {0..1}  {    -- Device
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                        }
                    }
                }
            }
        }
    }

ontology
    term_definitions = <
        ["en"] = <
            items = <
                ["at0000"] = <
                    description = <"Generic laboratory result archetype to allow terminology driven results on a generic framework">
                    text = <"Laboratory result">
                >
                ["at0001"] = <
                    description = <"@ internal @">
                    text = <"history">
                >
                ["at0002"] = <
                    description = <"Any event in a time series">
                    text = <"Any event">
                >
                ["at0003"] = <
                    description = <"@ internal @">
                    text = <"Tree">
                >
                ["at0004"] = <
                    description = <"Specimen details">
                    text = <"Specimen">
                >
                ["at0006"] = <
                    description = <"Description of the specimen">
                    text = <"Description">
                >
                ["at0007"] = <
                    description = <"The site of the body where the specimen was collected">
                    text = <"Body site">
                >
                ["at0008"] = <
                    description = <"The type of diagnostic service">
                    text = <"Diagnostic service">
                >
                ["at0009"] = <
                    description = <"Biochemical and chemical analysis">
                    text = <"Chemistry">
                >
                ["at0010"] = <
                    description = <"Results of microbiological analysis">
                    text = <"Microbiology">
                >
                ["at0011"] = <
                    description = <"A cluster to enable level one battery labels">
                    text = <"level 1">
                >
                ["at0012"] = <
                    description = <"A cluster to enable level 2 battery labels">
                    text = <"level 2">
                >
                ["at0013"] = <
                    description = <"Generic result - data type is not set">
                    text = <"Any result">
                >
                ["at0014"] = <
                    description = <"Comments relating to a specific result @Path">
                    text = <"Comment">
                >
                ["at0015"] = <
                    description = <"The path of the result to which the comment relates">
                    text = <"Path">
                >
                ["at0016"] = <
                    description = <"Comment relating to a specific result at the path indicated">
                    text = <"Comment">
                >
                ["at0017"] = <
                    description = <"Comment on all results">
                    text = <"Overall Comment">
                >
                ["at0018"] = <
                    description = <"Quality parameters">
                    text = <"Quality">
                >
                ["at0019"] = <
                    description = <"Specimen quality paraments">
                    text = <"Specimen">
                >
                ["at0020"] = <
                    description = <"Issue arising with specimen">
                    text = <"Issue">
                >
                ["at0021"] = <
                    description = <"The specimen was haemolysed">
                    text = <"Haemolysed">
                >
                ["at0022"] = <
                    description = <"The specimen was lipaemic">
                    text = <"Lipaemic">
                >
                ["at0023"] = <
                    description = <"An incorrect preservative was used when transporting the specimen">
                    text = <"Incorrect preservative">
                >
                ["at0024"] = <
                    description = <"An insufficient sample was given to undertake measurement">
                    text = <"Insufficient sample">
                >
                ["at0025"] = <
                    description = <"The degree of the stated issue">
                    text = <"Rating">
                >
                ["at0026"] = <
                    description = <"Handling quality parameters">
                    text = <"Handling">
                >
                ["at0027"] = <
                    description = <"Issue arising with handling of the specimen">
                    text = <"Issue">
                >
                ["at0028"] = <
                    description = <"A handling error occurred">
                    text = <"Handling error">
                >
                ["at0029"] = <
                    description = <"The specimen was delivered too long after it was taken">
                    text = <"Age">
                >
                ["at0030"] = <
                    description = <"An accident occurred with the sample in the laboratory">
                    text = <"Laboratory accident">
                >
                ["at0031"] = <
                    description = <"The specimen could not be analysed for technical reasons">
                    text = <"Fail">
                >
                ["at0032"] = <
                    description = <"A description of the quality issue">
                    text = <"Description">
                >
                ["at0033"] = <
                    description = <"@ internal @">
                    text = <"Tree">
                >
                ["at0034"] = <
                    description = <"Information identifying the laboratory and specimen">
                    text = <"Identification">
                >
                ["at0035"] = <
                    description = <"The identifying information about the specimen">
                    text = <"Specimen identification">
                >
                ["at0036"] = <
                    description = <"Information identiying the laboratory">
                    text = <"Laboratory">
                >
                ["at0037"] = <
                    description = <"The laboratory result in a specific display format">
                    text = <"Multimedia representation">
                >
                ["at0038"] = <
                    description = <"The device used to make the measurement">
                    text = <"Device">
                >
                ["at0039"] = <
                    description = <"Details about the specimen">
                    text = <"Specimen details">
                >
                ["at0040"] = <
                    description = <"The date and time the specimen was received in the laboratory">
                    text = <"DateTime received">
                >
                ["at0041"] = <
                    description = <"The date and time the specimen was processed in the laboratory">
                    text = <"DateTime processed">
                >
                ["at0042"] = <
                    description = <"*">
                    text = <"Methods">
                >
            >
        >
    >
    constraint_definitions = <
        ["en"] = <
            items = <
                ["ac0000"] = <
                    description = <"Any name for a set of tests from the LOINC set of battery names">
                    text = <"=LOINC::Battery_name">
                >
                ["ac0001"] = <
                    description = <"Any name for a set of tests from the LOINC set of battery names">
                    text = <"=LOINC::Battery_name">
                >
            >
        >
    >