archetype (adl_version=1.4)
    openEHR-EHR-ITEM_TREE.referral.v1

concept
    [at0000]    -- Referral data
language
    original_language = <[ISO_639-1::en]>
description
    original_author = <
        ["name"] = <"Sam Heard">
        ["organisation"] = <"Ocean Informatics">
        ["date"] = <"22/04/2006">
        ["email"] = <"sam.heard@oceaninformatics.biz">
    >
    details = <
        ["en"] = <
            language = <[ISO_639-1::en]>
            purpose = <"For recording information about a referral as part of an instruction or action.">
            use = <"">
            misuse = <"">
        >
    >
    lifecycle_state = <"Initial">
    other_contributors = <>

definition
    ITEM_TREE[at0000] occurrences  {0..*}  {    -- Referral data
        items cardinality  {0..*; unordered}  {
            ELEMENT[at0002]  {    -- Clinical issue
                value  {
                    DV_TEXT  {*}
                }
            }
            ELEMENT[at0035] occurrences  {0..1}  {    -- Other details
                value  {
                    DV_TEXT  {*}
                }
            }
            CLUSTER[at0014] occurrences  {0..1}  {    -- Referring provider details
                items cardinality  {1; unordered}  {
                    ELEMENT[at0015]  {    -- Name of referring provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    ELEMENT[at0017] occurrences  {0..1}  {    -- Role of referring provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    ELEMENT[at0016] occurrences  {0..1}  {    -- Address of referring provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    CLUSTER[at0026] occurrences  {0..1}  {    -- Contact details of the referring provider
                        items cardinality  {0..*; unordered}  {
                            ELEMENT[at0025] occurrences  {0..*}  {    -- Telephone
                                name  {
                                    DV_CODED_TEXT  {
                                        defining_code  {
                                            [local::
                                            at0029,     -- Mobile
                                            at0030,     -- Work
                                            at0031,     -- Alternative work
                                            at0032,     -- Direct work line
                                            at0033]    -- Pager
                                        }
                                    }
                                }
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                            ELEMENT[at0028] occurrences  {0..1}  {    -- Email
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                            ELEMENT[at0027] occurrences  {0..1}  {    -- Faxsimile
                                value  {
                                    DV_TEXT  {*}
                                }
                            }
                        }
                    }
                }
            }
            CLUSTER[at0021]  {    -- Secondary provider details
                items cardinality  {1..*; unordered}  {
                    ELEMENT[at0022] occurrences  {0..1}  {    -- Name of secondary provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    ELEMENT[at0024] occurrences  {0..1}  {    -- Role of secondary provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    ELEMENT[at0023] occurrences  {0..1}  {    -- Address of secondary provider
                        value  {
                            DV_TEXT  {*}
                        }
                    }
                    CLUSTER[at0034] occurrences  {0..1}  {    -- Contact details of the secondary provider
                        items cardinality  {0..*; unordered}  {
                            use_node ELEMENT /items[at0014]/items[at0026]/items[at0025]
                            use_node ELEMENT /items[at0014]/items[at0026]/items[at0028]
                            use_node ELEMENT /items[at0014]/items[at0026]/items[at0027]
                        }
                    }
                }
            }
            CLUSTER[at0003] occurrences  {0..1}  {    -- Process
                items cardinality  {0..*; unordered}  {
                    CLUSTER[at0004] occurrences  {0..1}  {    -- Urgency
                        items cardinality  {0..*; unordered}  {
                            ELEMENT[at0005] occurrences  {0..1}  {    -- Timing
                                value  {
                                    0|[local::at0006],     -- Emergency
                                    1|[local::at0007],     -- Urgent
                                    2|[local::at0008]      -- Non-urgent
                                }
                            }
                            ELEMENT[at0009] occurrences  {0..1}  {    -- Impact
                                value  {
                                    0|[local::at0010],     -- High
                                    1|[local::at0011],     -- Moderate
                                    2|[local::at0012]      -- Low
                                }
                            }
                            ELEMENT[at0013] occurrences  {0..1}  {    -- Maximal delay
                                value  {
                                    C_DV_QUANTITY <
                                        property = <[openehr::128]>
                                        list = <
                                            ["1"] = <
                                                units = <"h">
                                                magnitude = <|>0.0|>
                                            >
                                            ["2"] = <
                                                units = <"d">
                                                magnitude = <|>0.0|>
                                            >
                                            ["3"] = <
                                                units = <"wk">
                                                magnitude = <|>0.0|>
                                            >
                                            ["4"] = <
                                                units = <"mo">
                                                magnitude = <|>0.0|>
                                            >
                                            ["5"] = <
                                                units = <"min">
                                            >
                                        >
                                    >
                                }
                            }
                        }
                    }
                    ELEMENT[at0018] occurrences  {0..1}  {    -- Date referred
                        value  {
                            DV_DATE_TIME  {
                                value  {yyyy-??-??T??:??:??}
                            }
                        }
                    }
                    ELEMENT[at0019] occurrences  {0..1}  {    -- Date first attended
                        value  {
                            DV_DATE_TIME  {
                                value  {yyyy-??-??T??:??:??}
                            }
                        }
                    }
                    ELEMENT[at0020] occurrences  {0..1}  {    -- Date last attended
                        value  {
                            DV_DATE_TIME  {
                                value  {yyyy-??-??T??:??:??}
                            }
                        }
                    }
                }
            }
        }
    }

ontology
    term_definitions = <
        ["en"] = <
            items = <
                ["at0000"] = <
                    description = <"Data about a referral recorded as part of instruction or actions">
                    text = <"Referral data">
                >
                ["at0002"] = <
                    description = <"The clinical issue that requires care from the second provider">
                    text = <"Clinical issue">
                >
                ["at0003"] = <
                    description = <"Information about the process of the referral">
                    text = <"Process">
                >
                ["at0004"] = <
                    description = <"information about the urgency of the referral">
                    text = <"Urgency">
                >
                ["at0005"] = <
                    description = <"The appropriate timing of the appointment">
                    text = <"Timing">
                >
                ["at0006"] = <
                    description = <"Person requires care immediately">
                    text = <"Emergency">
                >
                ["at0007"] = <
                    description = <"Person requires care as soon as possible">
                    text = <"Urgent">
                >
                ["at0008"] = <
                    description = <"Person requires care at providers convenience">
                    text = <"Non-urgent">
                >
                ["at0009"] = <
                    description = <"The impact of the condition on the person's life">
                    text = <"Impact">
                >
                ["at0010"] = <
                    description = <"The condition is having major impact on the person's ability to function">
                    text = <"High">
                >
                ["at0011"] = <
                    description = <"The condition is having an impact but the person is able to function to a large extent">
                    text = <"Moderate">
                >
                ["at0012"] = <
                    description = <"The condition is having little or no impact on the person's ability to function">
                    text = <"Low">
                >
                ["at0013"] = <
                    description = <"An indication of the maximum delay that would be reasonable before the person is seen">
                    text = <"Maximal delay">
                >
                ["at0014"] = <
                    description = <"Information about the referrer or primary provider">
                    text = <"Referring provider details">
                >
                ["at0015"] = <
                    description = <"The name of the referring provider">
                    text = <"Name of referring provider">
                >
                ["at0016"] = <
                    description = <"*">
                    text = <"Address of referring provider">
                >
                ["at0017"] = <
                    description = <"*">
                    text = <"Role of referring provider">
                >
                ["at0018"] = <
                    description = <"The date of the original referral">
                    text = <"Date referred">
                >
                ["at0019"] = <
                    description = <"The date the person first attended the secondary provider">
                    text = <"Date first attended">
                >
                ["at0020"] = <
                    description = <"The date the person last attended the second provider">
                    text = <"Date last attended">
                >
                ["at0021"] = <
                    description = <"Details about the provider to whom the referral is directed">
                    text = <"Secondary provider details">
                >
                ["at0022"] = <
                    description = <"The name of the provider to which the referral is directed">
                    text = <"Name of secondary provider">
                >
                ["at0023"] = <
                    description = <"The address of the provider to which the referral is directed">
                    text = <"Address of secondary provider">
                >
                ["at0024"] = <
                    description = <"The role of the provider to which the referral is directed">
                    text = <"Role of secondary provider">
                >
                ["at0025"] = <
                    description = <"Telephone contact information">
                    text = <"Telephone">
                >
                ["at0026"] = <
                    description = <"Contact details of the referring provider">
                    text = <"Contact details of the referring provider">
                >
                ["at0027"] = <
                    description = <"The faxsimile number of the provider">
                    text = <"Faxsimile">
                >
                ["at0028"] = <
                    description = <"Email address of the provider">
                    text = <"Email">
                >
                ["at0029"] = <
                    description = <"The mobile or cell phone number">
                    text = <"Mobile">
                >
                ["at0030"] = <
                    description = <"The work telephone number">
                    text = <"Work">
                >
                ["at0031"] = <
                    description = <"An alternative work telephone number">
                    text = <"Alternative work">
                >
                ["at0032"] = <
                    description = <"A phone number that is direct to the provider">
                    text = <"Direct work line">
                >
                ["at0033"] = <
                    description = <"A pager number to leave messages">
                    text = <"Pager">
                >
                ["at0034"] = <
                    description = <"*">
                    text = <"Contact details of the secondary provider">
                >
                ["at0035"] = <
                    description = <"Other details relevant to the referral">
                    text = <"Other details">
                >
            >
        >
    >