Using Hoot72
Last Update: 2009-08-20
Analysis of “A James goes through the Hospital”
A report on the A James goes through the Hospital graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 31 entries | |||
| 02 | <bed> | ||
| EC1 | FIRST EMERGENCY CONTACT | <contactRole> | |
| EC2 | SECOND EMERGENCY CONTACT | <contactRole> | |
| EM | EMPLOYER | <contactRole> | |
| 19 | <diagnosisCodingMethod> | ||
| 00 | <diagnosisType> | ||
| GENHOSP | <dietType> | ||
| ISHPEMING NURSING HOME | <dischargeLocation> | ||
| A | <financialClass> | ||
| SELF | <guarantorRelationship> | ||
| ICU | <hospitalService> | ||
| 0 | <insurancePlanCode> | ||
| S | <maritalStatus> | ||
| 1010.1 | HEIGHT | <observationCode> | |
| 1010.1 | BODY WEIGHT | <observationCode> | |
| I | <patientClass> | ||
| S | <patientType> | ||
| SICU | <pointOfCareCode> | ||
| SPOUSE | <relationship> | ||
| MOTHER | <relationship> | ||
| C | <religion> | ||
| 0001 | <room> | ||
| M | <sex> | ||
| cm | <units> | ||
| kg | <units> | ||
| M10 | <codeIdentifyingTheCheckDigitSchemeEmployed> | ||
| REGADT | <namespaceCode> | ||
| GENHOSP | <namespaceCode> | ||
| MCM | <namespaceCode> | ||
| CMS | <namespaceCode> | ||
| L | <organizationNameTypeCode> | ||
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 31 entries | ||
| 02 | <bed> | |
| EC1 | FIRST EMERGENCY CONTACT | <contactRole> |
| EC2 | SECOND EMERGENCY CONTACT | <contactRole> |
| EM | EMPLOYER | <contactRole> |
| 19 | <diagnosisCodingMethod> | |
| 00 | <diagnosisType> | |
| GENHOSP | <dietType> | |
| ISHPEMING NURSING HOME | <dischargeLocation> | |
| A | <financialClass> | |
| SELF | <guarantorRelationship> | |
| ICU | <hospitalService> | |
| 0 | <insurancePlanCode> | |
| S | <maritalStatus> | |
| 1010.1 | HEIGHT | <observationCode> |
| 1010.1 | BODY WEIGHT | <observationCode> |
| I | <patientClass> | |
| S | <patientType> | |
| SICU | <pointOfCareCode> | |
| SPOUSE | <relationship> | |
| MOTHER | <relationship> | |
| C | <religion> | |
| 0001 | <room> | |
| M | <sex> | |
| cm | <units> | |
| kg | <units> | |
| M10 | <codeIdentifyingTheCheckDigitSchemeEmployed> | |
| REGADT | <namespaceCode> | |
| GENHOSP | <namespaceCode> | |
| MCM | <namespaceCode> | |
| CMS | <namespaceCode> | |
| L | <organizationNameTypeCode> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| givenName | familyName | nameOfCodingSystem | p | simpleIdentifier |
|---|---|---|---|---|
| 16 entries | ||||
| JAMES | MASSIE | <diagnosisType> | 00 | |
| JAMES | MASSIE | <hospitalService> | ICU | |
| JAMES | MASSIE | <guarantorRelationship> | SELF | |
| JAMES | MASSIE | <diagnosisCodingMethod> | 19 | |
| JAMES | MASSIE | <units> | kg | |
| JAMES | MASSIE | <contactRole> | EC1 | |
| JAMES | MASSIE | <relationship> | SPOUSE | |
| JAMES | MASSIE | <dietType> | GENHOSP | |
| JAMES | MASSIE | <observationCode> | 1010.1 | |
| JAMES | MASSIE | <contactRole> | EM | |
| JAMES | MASSIE | <contactRole> | EC2 | |
| JAMES | MASSIE | <relationship> | MOTHER | |
| JAMES | MASSIE | <patientType> | S | |
| JAMES | MASSIE | <insurancePlanCode> | 0 | |
| JAMES | MASSIE | <units> | cm | |
| JAMES | MASSIE | <patientClass> | I | |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 14 entries | |
| 0100 | <admittingDoctor> |
| 0148 | <admittingDoctor> |
| 0200 | <attendingDoctor> |
| 0100 | <attendingDoctor> |
| 0148 | <attendingDoctor> |
| 0148 | <consultingDoctor> |
| BC1 | <insuranceCompanyId> |
| 4544 | <insuranceCompanyName> |
| 10199925 | <patientAccountNumber> |
| 10199923 | <patientAccountNumber> |
| 0148 | <referringDoctor> |
| 1400 | <context> |
| 191919 | <context> |
| 253763 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| givenName | familyName | pred |
|---|---|---|
| 8 entries | ||
| MOOSES AUTO CLINIC | <guarantorEmployerName> | |
| JAMES | MASSIE | <guarantorName> |
| ELLEN | MASSIE | <nkName> |
| MARYLOU | MASSIE | <nkName> |
| JAMES | ADDISON | <personName> |
| GEORGE | JONES | <personName> |
| JAMES | MASSIE | <personName> |
| CARL | ANDERSON | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| givenName | familyName |
|---|---|
| 4 entries | |
| ELLEN | MASSIE |
| MARYLOU | MASSIE |
| JAMES | MASSIE |
| MOOSES AUTO CLINIC | |
All people who act as doctors
Like the previous query except we only select people which are referred to by a predicate containing ‘doctor’
SELECT DISTINCT ?givenName ?familyName ?role WHERE { ?a ?role ?person . ?person hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName . FILTER regex(str(?role), "doctor", "i")}
| givenName | familyName | role |
|---|---|---|
| 7 entries | ||
| JAMES | ADDISON | <attendingDoctor> |
| CARL | ANDERSON | <admittingDoctor> |
| JAMES | ADDISON | <consultingDoctor> |
| JAMES | ADDISON | <admittingDoctor> |
| JAMES | ADDISON | <referringDoctor> |
| CARL | ANDERSON | <attendingDoctor> |
| GEORGE | JONES | <attendingDoctor> |
All organizations
Organizations are like people.
SELECT DISTINCT ?simpleName ?pred WHERE { ?a ?pred ?organizationName . ?organizationName a <http://www.hoot72.com/ontology/OrganizationName> . ?organizationName hoot72:simpleName ?simpleName} ORDER BY ?pred
| simpleName | pred |
|---|---|
| 2 entries | |
| ACME SOFTWARE COMPANY | <organizationName> |
| BLUE CROSS | <organizationName> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 16 entries | |
| 19660129 | <dateOfBirth> |
| 200901121005 | <dischargeDateTime> |
| 200901101400 | <expectedAdmitDate> |
| 200901101400 | <expectedSurgeryDateTime> |
| 19940605 | <startDate> |
| 200901121005 | <endTime> |
| 200901110025 | <endTime> |
| 200901110600 | <endTime> |
| 200901110603 | <endTime> |
| 200901110500 | <endTime> |
| 200901110025 | <startTime> |
| 200901110603 | <startTime> |
| 200901061000 | <startTime> |
| 200901110500 | <startTime> |
| 200901110600 | <startTime> |
| 200901121005 | <startTime> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.
All Observations (Literals)
SELECT DISTINCT ?observationCodeIdentifier ?observationText ?observationValue ?unitsIdentifier WHERE { ?a exo:observationValue ?observationValue . FILTER isLiteral(?observationValue) . ?a exo:observationCode ?observationCode . ?observationCode hoot72:simpleIdentifier ?observationCodeIdentifier . OPTIONAL { ?observationCode hoot72:text ?observationText} . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . OPTIONAL {?a exo:units ?units . ?units hoot72:simpleIdentifier ?unitsIdentifier}} ORDER BY ?observationValue
| observationCodeIdentifier | observationText | observationValue | unitsIdentifier |
|---|---|---|---|
| 2 entries | |||
| 1010.1 | HEIGHT | 190 | cm |
| 1010.1 | BODY WEIGHT | 62 | kg |
Analysis of “Insurance comes and goes”
A report on the Insurance comes and goes graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 6 entries | |||
| A789 | <insurancePlanCode> | ||
| A357 | <insurancePlanCode> | ||
| C45 | <insurancePlanCode> | ||
| GENHOSP | <namespaceCode> | ||
| REGADT | <namespaceCode> | ||
| MCM | <namespaceCode> | ||
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 6 entries | ||
| A789 | <insurancePlanCode> | |
| A357 | <insurancePlanCode> | |
| C45 | <insurancePlanCode> | |
| GENHOSP | <namespaceCode> | |
| REGADT | <namespaceCode> | |
| MCM | <namespaceCode> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| givenName | familyName | nameOfCodingSystem | p | simpleIdentifier |
|---|---|---|---|---|
| 3 entries | ||||
| JAMES | MASSIE | <insurancePlanCode> | A789 | |
| JAMES | MASSIE | <insurancePlanCode> | C45 | |
| JAMES | MASSIE | <insurancePlanCode> | A357 | |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 4 entries | |
| 6789 | <insuranceCompanyId> |
| 1234 | <insuranceCompanyId> |
| 253763 | <context> |
| 191919 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| Property | Value(s) |
|---|---|
| givenName | JAMES |
| familyName | MASSIE |
| pred | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| Property | Value(s) |
|---|
All organizations
Organizations are like people.
SELECT DISTINCT ?simpleName ?pred WHERE { ?a ?pred ?organizationName . ?organizationName a <http://www.hoot72.com/ontology/OrganizationName> . ?organizationName hoot72:simpleName ?simpleName} ORDER BY ?pred
| simpleName | pred |
|---|---|
| 2 entries | |
| BCMD | <organizationName> |
| VGMC | <organizationName> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 2 entries | |
| 19660129 | <dateOfBirth> |
| 200901061000 | <endTime> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.
Analysis of “Next of Kin come and go”
A report on the Next of Kin come and go graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 4 entries | |||
| O | <patientClass> | ||
| GENHOSP | <namespaceCode> | ||
| MCM | <namespaceCode> | ||
| REGADT | <namespaceCode> | ||
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 4 entries | ||
| O | <patientClass> | |
| GENHOSP | <namespaceCode> | |
| MCM | <namespaceCode> | |
| REGADT | <namespaceCode> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| Property | Value(s) |
|---|---|
| givenName | JAMES |
| familyName | MASSIE |
| p | <patientClass> |
| simpleIdentifier | O |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 3 entries | |
| 0148 | <attendingDoctor> |
| 253763 | <context> |
| 191919 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| givenName | familyName | pred |
|---|---|---|
| 2 entries | ||
| JAMES | ADDISON | <personName> |
| JAMES | MASSIE | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| Property | Value(s) |
|---|
All people who act as doctors
Like the previous query except we only select people which are referred to by a predicate containing ‘doctor’
SELECT DISTINCT ?givenName ?familyName ?role WHERE { ?a ?role ?person . ?person hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName . FILTER regex(str(?role), "doctor", "i")}
| Property | Value(s) |
|---|---|
| givenName | JAMES |
| familyName | ADDISON |
| role | <attendingDoctor> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 2 entries | |
| 19660129 | <dateOfBirth> |
| 200901061000 | <startTime> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.
Analysis of “LOINC:DT7 Samples - Orders”
A report on the LOINC:DT7 Samples - Orders graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 100 entries | |||
| 30963-3 | Vaccine purchased with | LN | <observationCode> |
| 30976-5 | Date received by manufacturer/immunization project | LN | <observationCode> |
| 30955-9 | Site | LN | <observationCode> |
| 31034-2 | Site | LN | <observationCode> |
| 30969-0 | Onset age | LN | <observationCode> |
| 30972-4 | Onset age | LN | <observationCode> |
| 30967-4 | Was adverse event reported previously | LN | <observationCode> |
| 30961-7 | Lot number | LN | <observationCode> |
| 30959-1 | Lot number | LN | <observationCode> |
| 30955-9 | Number of previous doses | LN | <observationCode> |
| 30960-9 | Number of previous doses | LN | <observationCode> |
| 30964-1 | Other medications | LN | <observationCode> |
| 30958-3 | Route | LN | <observationCode> |
| 30955-9 | Route | LN | <observationCode> |
| 30961-7 | Number of previous doses | LN | <observationCode> |
| 30958-3 | Route | LN | <observationCode> |
| 30961-7 | Route | LN | <observationCode> |
| 30948-4 | Vaccination adverse events and treatment, if any | LN | <observationCode> |
| 30971-6 | Adverse event | LN | <observationCode> |
| 30970-8 | Adverse event | LN | <observationCode> |
| 30949-2 | Vaccination adverse event outcome | LN | <observationCode> |
| 30956-7 | Vaccine type | LN | <observationCode> |
| 30961-7 | Vaccine type | LN | <observationCode> |
| 30952-6 | Date of vaccination | LN | <observationCode> |
| 30951-8 | Patient recovered | LN | <observationCode> |
| 30973-2 | Dose number in series | LN | <observationCode> |
| 30969-0 | Dose number in series | LN | <observationCode> |
| 30961-7 | date given | LN | <observationCode> |
| 31035-9 | date given | LN | <observationCode> |
| 30968-2 | Adverse event | LN | <observationCode> |
| 30966-6 | Pre-existing physician diagnosed allergies, birth defects, medical conditions | LN | <observationCode> |
| 30975-7 | Mfr./Imm. Proj. report no. | LN | <observationCode> |
| 30965-8 | Illness at time of vaccination (specify) | LN | <observationCode> |
| 30962- | Vaccinated at | LN | <observationCode> |
| 30957-5 | Manufacturer | LN | <observationCode> |
| 30955-9 | Manufacturer | LN | <observationCode> |
| 30961-7 | Site | LN | <observationCode> |
| 30974-0 | Number of brothers and sisters | LN | <observationCode> |
| 30955-9 | Lot number | LN | <observationCode> |
| 30969-0 | Adverse event | LN | <observationCode> |
| 30978-1 | Report type | LN | <observationCode> |
| 30957-5 | Manufacturer | LN | <observationCode> |
| 30955-9 | Manufacturer | LN | <observationCode> |
| 30955-9 | Vaccine type | LN | <observationCode> |
| 30954-2 | Relevant diagnostic tests/lab data | LN | <observationCode> |
| 30969-0 | Vaccine Type | LN | <observationCode> |
| 30956-7 | Vaccine Type | LN | <observationCode> |
| 30950-0 | Number of days hospitalized due to vaccination adverse event | LN | <observationCode> |
| 8339-4 | Body weight at birth | LN | <observationCode> |
| 30961-7 | Manufacturer | LN | <observationCode> |
| 21612-7 | Reported Patient Age | LN | <observationCode> |
| 30977-3 | 15 day report | LN | <observationCode> |
| 30947-6 | Date form completed | LN | <observationCode> |
| 30953-4 | Adverse event onset date and time | LN | <observationCode> |
| PBF | Public funds | NIP008 | <observationValue> |
| LA | Left arm | HL70163 | <observationValue> |
| N | no | NIP009 | <observationValue> |
| IM | Intramuscular | HL70162 | <observationValue> |
| SC | Subcutaneaous | HL70162 | <observationValue> |
| E | required emergency room/doctor visit | NIP005 | <observationValue> |
| 10 | IPV | CVX | <observationValue> |
| Y | Yes | HL70239 | <observationValue> |
| LA | Left arm | HL70163 | <observationValue> |
| H | required hospitalization | NIP005 | <observationValue> |
| PVT | Private doctor’s office/hospital | NIP009 | <observationValue> |
| WAL | Wyeth_Ayerst | MVX | <observationValue> |
| IM | Intramuscular | HL70162 | <observationValue> |
| IN | Initial | NIP010 | <observationValue> |
| MSD | Merck | MVX | <observationValue> |
| 50 | DTaP-Hib | CVX | <observationValue> |
| 08 | HepB-Adolescent/pediatric | CVX | <observationValue> |
| PMC | Aventis Pasteur | MVX | <observationValue> |
| N | No | HL70136 | <observationValue> |
| 2106-3 | White | HL70005 | <race> |
| FVP | Form completed by (Name)-Vaccine provider | HL70063 | <relationship> |
| VAB | Vaccine administered by (Name) | HL70063 | <relationship> |
| M | <sex> | ||
| mo | month | ANSI | <units> |
| d | day | ANSI | <units> |
| oz | ounces | ANSI | <units> |
| 30968-2 | Adverse event following prior vaccination in patient | LN | <universalServiceCode> |
| 30970-8 | Adverse event following prior vaccination in sister | LN | <universalServiceCode> |
| 30969-0 | Adverse event following prior vaccination in brother | LN | <universalServiceCode> |
| For children 5 and under | <universalServiceCode> | ||
| 30955-9 | All vaccines given on date listed in #10 | LN | <universalServiceCode> |
| Only for reports submitted by manufacturer/immunization project | <universalServiceCode> | ||
| CDC VAERS-1 (FDA) Report | <universalServiceCode> | ||
| 30961-7 | Any other vaccinations within 4 weeks prior to the date listed in #10 | <universalServiceCode> | |
| O | <addressType> | ||
| M | <addressType> | ||
| GA121 | <countyParishCode> | ||
| GA067 | <countyParishCode> | ||
| MR | <identifierTypeCode> | ||
| LR | <identifierTypeCode> | ||
| SR | <identifierTypeCode> | ||
| L | <nameTypeCode> | ||
| GA0000 | <namespaceCode> | ||
| L | <sourceTable> | ||
| PRN | <telecommunicationEquipmentTypeCode> | ||
| WPN | <telecommunicationEquipmentTypeCode> | ||
Non HL7 Named Coding Schemes
Standard codes - ex/ LN for LOINC - and clearly specified local schemes.
SELECT DISTINCT ?nameOfCodingSystem WHERE { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem . FILTER (!regex(str(?nameOfCodingSystem), "HL7"))} ORDER BY ?nameOfCodingSystem
| nameOfCodingSystem |
|---|
| 8 entries |
| ANSI |
| CVX |
| LN |
| MVX |
| NIP005 |
| NIP008 |
| NIP009 |
| NIP010 |
HL7 Schemes
Though identified, HL7 codes are open ended and vary site by site.
SELECT DISTINCT ?nameOfCodingSystem WHERE { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem . FILTER regex(str(?nameOfCodingSystem), "HL7")}
| nameOfCodingSystem |
|---|
| 7 entries |
| HL70239 |
| HL70163 |
| HL70162 |
| HL70063 |
| HL70163 |
| HL70136 |
| HL70005 |
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 14 entries | ||
| PRN | <telecommunicationEquipmentTypeCode> | |
| O | <addressType> | |
| GA121 | <countyParishCode> | |
| L | <nameTypeCode> | |
| WPN | <telecommunicationEquipmentTypeCode> | |
| GA0000 | <namespaceCode> | |
| MR | <identifierTypeCode> | |
| LR | <identifierTypeCode> | |
| M | <sex> | |
| L | <sourceTable> | |
| 30961-7 | Any other vaccinations within 4 weeks prior to the date listed in #10 | <universalServiceCode> |
| M | <addressType> | |
| GA067 | <countyParishCode> | |
| SR | <identifierTypeCode> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| givenName | familyName | nameOfCodingSystem | p | simpleIdentifier |
|---|---|---|---|---|
| 64 entries | ||||
| John | Doe | CVX | <observationValue> | 08 |
| John | Doe | HL70239 | <observationValue> | Y |
| John | Doe | LN | <observationCode> | 30976-5 |
| John | Doe | LN | <observationCode> | 30971-6 |
| John | Doe | LN | <observationCode> | 30955-9 |
| John | Doe | MVX | <observationValue> | MSD |
| John | Doe | LN | <observationCode> | 30961-7 |
| John | Doe | HL70163 | <observationValue> | LA |
| John | Doe | NIP005 | <observationValue> | H |
| John | Doe | ANSI | <units> | d |
| John | Doe | MVX | <observationValue> | PMC |
| John | Doe | HL70162 | <observationValue> | IM |
| John | Doe | LN | <observationCode> | 30957-5 |
| John | Doe | LN | <observationCode> | 30968-2 |
| John | Doe | LN | <observationCode> | 30963-3 |
| John | Doe | LN | <observationCode> | 30973-2 |
| John | Doe | LN | <observationCode> | 30975-7 |
| John | Doe | NIP009 | <observationValue> | N |
| John | Doe | LN | <observationCode> | 30948-4 |
| John | Doe | LN | <observationCode> | 30967-4 |
| John | Doe | LN | <observationCode> | 30966-6 |
| John | Doe | HL70163 | <observationValue> | LA |
| John | Doe | LN | <observationCode> | 30958-3 |
| John | Doe | HL70063 | <relationship> | FVP |
| John | Doe | LN | <observationCode> | 30956-7 |
| John | Doe | LN | <observationCode> | 30960-9 |
| John | Doe | HL70136 | <observationValue> | N |
| John | Doe | LN | <observationCode> | 30969-0 |
| John | Doe | LN | <observationCode> | 30953-4 |
| John | Doe | ANSI | <units> | oz |
| John | Doe | LN | <observationCode> | 30959-1 |
| John | Doe | LN | <observationCode> | 30962- |
| John | Doe | CVX | <observationValue> | 50 |
| John | Doe | LN | <observationCode> | 30974-0 |
| John | Doe | CVX | <observationValue> | 10 |
| John | Doe | LN | <observationCode> | 30947-6 |
| John | Doe | LN | <observationCode> | 31034-2 |
| John | Doe | LN | <observationCode> | 30977-3 |
| John | Doe | HL70162 | <observationValue> | SC |
| John | Doe | LN | <observationCode> | 21612-7 |
| John | Doe | LN | <observationCode> | 30965-8 |
| John | Doe | LN | <observationCode> | 31035-9 |
| John | Doe | <universalServiceCode> | 30961-7 | |
| John | Doe | NIP009 | <observationValue> | PVT |
| John | Doe | LN | <observationCode> | 30949-2 |
| John | Doe | LN | <universalServiceCode> | 30969-0 |
| John | Doe | MVX | <observationValue> | WAL |
| John | Doe | ANSI | <units> | mo |
| John | Doe | LN | <universalServiceCode> | 30968-2 |
| John | Doe | LN | <observationCode> | 30978-1 |
| John | Doe | NIP008 | <observationValue> | PBF |
| John | Doe | LN | <observationCode> | 30950-0 |
| John | Doe | LN | <observationCode> | 30952-6 |
| John | Doe | LN | <observationCode> | 8339-4 |
| John | Doe | LN | <universalServiceCode> | 30955-9 |
| John | Doe | NIP010 | <observationValue> | IN |
| John | Doe | LN | <observationCode> | 30970-8 |
| John | Doe | LN | <universalServiceCode> | 30970-8 |
| John | Doe | LN | <observationCode> | 30972-4 |
| John | Doe | LN | <observationCode> | 30951-8 |
| John | Doe | LN | <observationCode> | 30954-2 |
| John | Doe | HL70063 | <relationship> | VAB |
| John | Doe | LN | <observationCode> | 30964-1 |
| John | Doe | NIP005 | <observationValue> | E |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 4 entries | |
| 1234567 | <orderingProvider> |
| 1234 | <context> |
| 00725 | <context> |
| 1234-12 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| givenName | familyName | pred |
|---|---|---|
| 3 entries | ||
| Jane | Jones | <nkName> |
| Marcus | Welby | <personName> |
| John | Doe | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| givenName | familyName |
|---|---|
| 1 entries | |
| Jane | Jones |
All practitioners
All practitioners - doctors, nurses etc - which is all people in the context of a patient excluding guarantors, relations etc. But too much exclusion causes problems for some graphs! Example of need to hone graphs. The filtered predicate ‘p’ is included in the results to promote honing.
SELECT DISTINCT ?practitionerGivenName ?practitionerFamilyName ?p WHERE { ?a hoot72:tcontext ?patient . {?a ?p ?practitioner . ?practitioner a <http://www.hoot72.com/ontology/IdentifiedThing> . ?practitioner hoot72:personName ?practitionerName } UNION {?a ?p ?practitionerName} . FILTER (!regex(str(?p), "guarantorName|nkName")) . ?practitionerName hoot72:familyName ?practitionerFamilyName ; hoot72:givenName ?practitionerGivenName}
| Property | Value(s) |
|---|---|
| practitionerGivenName | Marcus |
| practitionerFamilyName | Welby |
| p | <orderingProvider> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 7 entries | |
| 20001007 | <dateOfBirth> |
| 20010316 | <observationDateTime> |
| 12345678 | <observationValue> |
| 20010216 | <observationValue> |
| 20001216 | <observationValue> |
| 20010316 | <observationValue> |
| 200102180900 | <observationValue> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.
All Observations (Literals)
SELECT DISTINCT ?observationCodeIdentifier ?observationText ?observationValue ?unitsIdentifier WHERE { ?a exo:observationValue ?observationValue . FILTER isLiteral(?observationValue) . ?a exo:observationCode ?observationCode . ?observationCode hoot72:simpleIdentifier ?observationCodeIdentifier . OPTIONAL { ?observationCode hoot72:text ?observationText} . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . OPTIONAL {?a exo:units ?units . ?units hoot72:simpleIdentifier ?unitsIdentifier}} ORDER BY ?observationValue
| observationCodeIdentifier | observationText | observationValue | unitsIdentifier |
|---|---|---|---|
| 30 entries | |||
| 30960-9 | Number of previous doses | 01 | |
| 30961-7 | Number of previous doses | 01 | |
| 30955-9 | Number of previous doses | 01 | |
| 30955-9 | Number of previous doses | 01I | |
| 30960-9 | Number of previous doses | 01I | |
| 30950-0 | Number of days hospitalized due to vaccination adverse event | 02 | d |
| 30973-2 | Dose number in series | 02 | |
| 30969-0 | Dose number in series | 02 | |
| 30969-0 | Onset age | 04 | mo |
| 30972-4 | Onset age | 04 | mo |
| 21612-7 | Reported Patient Age | 05 | mo |
| 30975-7 | Mfr./Imm. Proj. report no. | 12345678 | |
| 30974-0 | Number of brothers and sisters | 2 | |
| 8339-4 | Body weight at birth | 82 | oz |
| 30954-2 | Relevant diagnostic tests/lab data | Electrolytes, CBC, Blood culture | |
| 30955-9 | Lot number | MRK12345 | |
| 30959-1 | Lot number | MRK12345 | |
| 30971-6 | Adverse event | None | |
| 30970-8 | Adverse event | None | |
| 30964-1 | Other medications | None | |
| 30968-2 | Adverse event | None | |
| 30965-8 | Illness at time of vaccination (specify) | None | |
| 30961-7 | Lot number | PMC123456 | |
| 30959-1 | Lot number | PMC123456 | |
| 30966-6 | Pre-existing physician diagnosed allergies, birth defects, medical conditions | Past conditions convulsions | |
| 30955-9 | Lot number | W46932777 | |
| 30959-1 | Lot number | W46932777 | |
| 30948-4 | Vaccination adverse events and treatment, if any | fever of 106F, with vomiting, seizures, persistent crying lasting over 3 hours, loss of appetite | |
| 30971-6 | Adverse event | vomiting, fever, otitis media | |
| 30969-0 | Adverse event | vomiting, fever, otitis media | |
All Observations (Types)
Types - People, Phone Numbers etc.
SELECT DISTINCT ?typ WHERE { ?a exo:observationValue ?observationValue . ?observationValue a ?typ} ORDER BY ?typ
| typ |
|---|
| 2 entries |
| <Code> |
| <Time> |
Analysis of “Utah Notifiable Disease Reporting using HL7″
A report on the Utah Notifiable Disease Reporting using HL7 graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 30 entries | |||
| MED | <hospitalService> | ||
| PED | <hospitalService> | ||
| 00000-0 | PROVIDER NAME | LN | <observationCode> |
| 00000-0 | CONTACT PHONE | LN | <observationCode> |
| 00000-0 | CONTACT NAME | LN | <observationCode> |
| 21612-7 | PATIENT AGE | LN | <observationCode> |
| Hepatitis C RN | LN | <observationCode> | |
| 00000-0 | PROVIDER PHONE | LN | <observationCode> |
| 00000-0 | ALERT DATE | LN | <observationCode> |
| 00000-0 | PREVIOUS ADMIT DATE | LN | <observationCode> |
| 45403-3 | ROOM NUMBER | LN | <observationCode> |
| 42347-5 | ADMIT DIAGNOSIS | LN | <observationCode> |
| 22025-1 | PROVIDER ID | LN | <observationCode> |
| Bordatella Per | LN | <observationCode> | |
| INTERPRETIVE T | LN | <observationCode> | |
| See Note | <observationValue> | ||
| I | <patientClass> | ||
| O | <patientClass> | ||
| W | <race> | ||
| SNM | <reasonForStudy> | ||
| F | <resultStatus> | ||
| M | <sex> | ||
| Blood; | <specimenSourceNameOrCode> | ||
| Nose;(Nasal) | <specimenSourceNameOrCode> | ||
| LABRPT | <universalServiceCode> | ||
| NOTF | <universalServiceCode> | ||
| USA | <country> | ||
| IHC-LD | <namespaceCode> | ||
| IHC-IM | <namespaceCode> | ||
| RT-CEND | <namespaceCode> | ||
Non HL7 Named Coding Schemes
Standard codes - ex/ LN for LOINC - and clearly specified local schemes.
SELECT DISTINCT ?nameOfCodingSystem WHERE { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem . FILTER (!regex(str(?nameOfCodingSystem), "HL7"))} ORDER BY ?nameOfCodingSystem
| Property | Value(s) |
|---|---|
| nameOfCodingSystem | LN |
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 15 entries | ||
| PED | <hospitalService> | |
| O | <patientClass> | |
| W | <race> | |
| F | <resultStatus> | |
| M | <sex> | |
| Blood; | <specimenSourceNameOrCode> | |
| Nose;(Nasal) | <specimenSourceNameOrCode> | |
| LABRPT | <universalServiceCode> | |
| NOTF | <universalServiceCode> | |
| USA | <country> | |
| IHC-LD | <namespaceCode> | |
| IHC-IM | <namespaceCode> | |
| RT-CEND | <namespaceCode> | |
| MED | <hospitalService> | |
| I | <patientClass> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| givenName | familyName | nameOfCodingSystem | p | simpleIdentifier |
|---|---|---|---|---|
| 20 entries | ||||
| EDWARD | MURROW | <hospitalService> | MED | |
| EDWARD | MURROW | LN | <observationCode> | 00000-0 |
| EDWARD | MURROW | <universalServiceCode> | LABRPT | |
| EDWARD | MURROW | LN | <observationCode> | 45403-3 |
| JAMES | CRAIG | <universalServiceCode> | LABRPT | |
| JAMES | CRAIG | <patientClass> | O | |
| EDWARD | MURROW | LN | <observationCode> | 42347-5 |
| JAMES | CRAIG | LN | <observationCode> | 21612-7 |
| JAMES | CRAIG | LN | <observationCode> | 42347-5 |
| JAMES | CRAIG | <hospitalService> | PED | |
| EDWARD | MURROW | <universalServiceCode> | NOTF | |
| EDWARD | MURROW | <patientClass> | I | |
| EDWARD | MURROW | LN | <observationCode> | 21612-7 |
| EDWARD | MURROW | LN | <observationCode> | 22025-1 |
| JAMES | CRAIG | LN | <observationCode> | 22025-1 |
| JAMES | CRAIG | <universalServiceCode> | NOTF | |
| JAMES | CRAIG | LN | <observationCode> | 45403-3 |
| JAMES | CRAIG | <resultStatus> | F | |
| EDWARD | MURROW | <resultStatus> | F | |
| JAMES | CRAIG | LN | <observationCode> | 00000-0 |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 4 entries | |
| 216812 | <context> |
| 199954 | <context> |
| 549442703 | <context> |
| 265840 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| givenName | familyName | pred |
|---|---|---|
| 4 entries | ||
| RYOMA | TANAKA | <observationValue> |
| GALINA | HORNYIK | <observationValue> |
| JAMES | CRAIG | <personName> |
| EDWARD | MURROW | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| givenName | familyName |
|---|---|
| 2 entries | |
| RYOMA | TANAKA |
| GALINA | HORNYIK |
All practitioners
All practitioners - doctors, nurses etc - which is all people in the context of a patient excluding guarantors, relations etc. But too much exclusion causes problems for some graphs! Example of need to hone graphs. The filtered predicate ‘p’ is included in the results to promote honing.
SELECT DISTINCT ?practitionerGivenName ?practitionerFamilyName ?p WHERE { ?a hoot72:tcontext ?patient . {?a ?p ?practitioner . ?practitioner a <http://www.hoot72.com/ontology/IdentifiedThing> . ?practitioner hoot72:personName ?practitionerName } UNION {?a ?p ?practitionerName} . FILTER (!regex(str(?p), "guarantorName|nkName")) . ?practitionerName hoot72:familyName ?practitionerFamilyName ; hoot72:givenName ?practitionerGivenName}
| practitionerGivenName | practitionerFamilyName | p |
|---|---|---|
| 2 entries | ||
| RYOMA | TANAKA | <observationValue> |
| GALINA | HORNYIK | <observationValue> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 11 entries | |
| 200901250530Z | <admitDateTime> |
| 200901270704Z | <admitDateTime> |
| 000000000000Z | <dateOfBirth> |
| 200901281432Z | <observationValue> |
| 200612082039Z | <observationValue> |
| 200901281928Z | <observationValue> |
| 200406141036Z | <observationValue> |
| 200901261225Z | <requestedDateTime> |
| 200901270720Z | <requestedDateTime> |
| 200901261236Z | <specimenReceivedDateTime> |
| 200901280720Z | <specimenReceivedDateTime> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.
All Observations (Literals)
SELECT DISTINCT ?observationCodeIdentifier ?observationText ?observationValue ?unitsIdentifier WHERE { ?a exo:observationValue ?observationValue . FILTER isLiteral(?observationValue) . ?a exo:observationCode ?observationCode . ?observationCode hoot72:simpleIdentifier ?observationCodeIdentifier . OPTIONAL { ?observationCode hoot72:text ?observationText} . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . OPTIONAL {?a exo:units ?units . ?units hoot72:simpleIdentifier ?unitsIdentifier}} ORDER BY ?observationValue
| observationCodeIdentifier | observationText | observationValue | unitsIdentifier |
|---|---|---|---|
| 9 entries | |||
| 22025-1 | PROVIDER ID | 06740 | |
| 21612-7 | PATIENT AGE | 2 | |
| 22025-1 | PROVIDER ID | 29823 | |
| 21612-7 | PATIENT AGE | 45 | |
| 42347-5 | ADMIT DIAGNOSIS | CHOLE | |
| 00000-0 | CONTACT NAME | Carrie Taylor | |
| 45403-3 | ROOM NUMBER | E635 | |
| 42347-5 | ADMIT DIAGNOSIS | POSSIBLE B.PERT EXPO | |
| 45403-3 | ROOM NUMBER | XBCBS | |
All Observations (Types)
Types - People, Phone Numbers etc.
SELECT DISTINCT ?typ WHERE { ?a exo:observationValue ?observationValue . ?observationValue a ?typ} ORDER BY ?typ
| typ |
|---|
| 4 entries |
| <Code> |
| <PersonName> |
| <TelecommunicationNumber> |
| <Time> |
Admit diagnoses known
This is a standard query. It leverages LOINC codes.
SELECT DISTINCT ?observationValue WHERE { ?a exo:observationValue ?observationValue . ?a exo:observationCode ?observationCode . ?observationCode hoot72:nameOfCodingSystem ?nameOfCodingSystem . FILTER(str(?nameOfCodingSystem) = "LN") . ?observationCode hoot72:simpleIdentifier ?observationCodeIdentifier . FILTER(str(?observationCodeIdentifier) = "42347-5")}
| observationValue |
|---|
| 2 entries |
| POSSIBLE B.PERT EXPO |
| CHOLE |
Patients with an admit diagnosis
This is a standard query. It leverages LOINC codes and context
SELECT DISTINCT ?givenName ?familyName WHERE { ?patient hoot72:personName [ hoot72:givenName ?givenName ; hoot72:familyName ?familyName ] . [ hoot72:tcontext ?patient ; ?codePredicate [ hoot72:nameOfCodingSystem "LN" ; hoot72:simpleIdentifier "42347-5" ] ] }
| givenName | familyName |
|---|---|
| 2 entries | |
| JAMES | CRAIG |
| EDWARD | MURROW |
Analysis of “2.3 Patient Care”
A report on the 2.3 Patient Care graph, described here in the Mapping paper.
Code
In the main, a code identifies a concept in a taxonomy. Querying medical data means using and mapping codes.
All codes
Look through the ‘nameOfCodingSystem’ column. Many (in some cases, all) don’t designate their scheme, some are site-specific, some are standard (ex/ LN for LOINC, ANSI for ANSI)
SELECT DISTINCT ?simpleIdentifier ?text ?nameOfCodingSystem ?pred WHERE { ?a ?pred ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:simpleIdentifier ?simpleIdentifier} . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem }} ORDER BY ?pred
| simpleIdentifier | text | nameOfCodingSystem | pred |
|---|---|---|---|
| 38 entries | |||
| 0047-0402-30 | Ampicillin 250 MG TAB | NDC | <administeredCode> |
| TAB | <administeredUnits> | ||
| ADM | <admitSource> | ||
| N | <allowSubstitutions> | ||
| 01 | <bed> | ||
| HI | High | Certainty Coding List | <certaintyOfProblem> |
| Due | Review Due | Next Review List | <currentGoalReviewStatus> |
| 00312 | Improve Peripheral Circulation | Goal Master List | <goalCode> |
| SUR | <hospitalService> | ||
| 1 | Fully | Awareness Coding List | <individualAwarenessOfProblem> |
| Peripheral Dependent Edema | <observationCode> | ||
| OH457 | Open Heart Pathway | AHCPR | <pathwayCode> |
| A1 | Active | Pathway Life Cycle Status List | <pathwayLifecycleStatus> |
| I | <patientClass> | ||
| 2000 | <pointOfCareCode> | ||
| IP | Inpatient | Problem Classification List | <problemClassification> |
| 04411 | Restricted Circulation | Nursing Problem List | <problemCode> |
| C | Confirmed | Confirmation Status List | <problemConfirmationStatus> |
| A1 | Active | Life Cycle Status List | <problemLifeCycleStatus> |
| NU | Nursing | Management Discipline List | <problemManagementDiscipline> |
| Acute | Acute | Persistence List | <problemPersistence> |
| 2 | Good | Prognosis Coding List | <problemPrognosis> |
| 2 | Secondary | Ranking List | <problemRanking> |
| D5W WITH 1/2 NS WITH 20 MEQ KCL EVERY THIRD BOTTLE STARTING WITH FIRST | <providersPharmacyInstructions> | ||
| Q6H | <repeatPattern> | ||
| C | <repeatPattern> | ||
| IV | <requestedDosageForm> | ||
| L | <requestedGiveUnits> | ||
| 12 | Primary Nurse | Role Master List | <role> |
| 1 | Diagnosing Provider | Role Master List | <role> |
| 45 | Recorder | Role Master List | <role> |
| 2012 | <room> | ||
| 23 | Coincident | Variance Class List | <varianceClassification> |
| PCIS | <namespaceCode> | ||
| MEDCENTER | <namespaceCode> | ||
| OE | <namespaceCode> | ||
| PCIS1 | <namespaceCode> | ||
| RX | <namespaceCode> | ||
Non HL7 Named Coding Schemes
Standard codes - ex/ LN for LOINC - and clearly specified local schemes.
SELECT DISTINCT ?nameOfCodingSystem WHERE { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem . FILTER (!regex(str(?nameOfCodingSystem), "HL7"))} ORDER BY ?nameOfCodingSystem
| nameOfCodingSystem |
|---|
| 17 entries |
| AHCPR |
| Awareness Coding List |
| Certainty Coding List |
| Confirmation Status List |
| Goal Master List |
| Life Cycle Status List |
| Management Discipline List |
| NDC |
| Next Review List |
| Nursing Problem List |
| Pathway Life Cycle Status List |
| Persistence List |
| Problem Classification List |
| Prognosis Coding List |
| Ranking List |
| Role Master List |
| Variance Class List |
Codes without a scheme identifier - use predicates
Without a designation of a type, we must fall back on the predicate referencing a code. In most cases, this is sufficient. For example, ’sex’, ‘units’ etc. Some codes embed a piece of free-form text which may help with identification.
SELECT DISTINCT ?simpleIdentifier ?text ?pred WHERE { ?a ?pred ?code . ?code rdf:type <http://www.hoot72.com/ontology/Code> ; hoot72:simpleIdentifier ?simpleIdentifier . OPTIONAL { ?code hoot72:text ?text } . OPTIONAL { ?code hoot72:nameOfCodingSystem ?nameOfCodingSystem} FILTER(!bound(?nameOfCodingSystem)) } ORDER BY ?pred
| simpleIdentifier | text | pred |
|---|---|---|
| 18 entries | ||
| TAB | <administeredUnits> | |
| ADM | <admitSource> | |
| N | <allowSubstitutions> | |
| D5W WITH 1/2 NS WITH 20 MEQ KCL EVERY THIRD BOTTLE STARTING WITH FIRST | <providersPharmacyInstructions> | |
| IV | <requestedDosageForm> | |
| L | <requestedGiveUnits> | |
| PCIS | <namespaceCode> | |
| MEDCENTER | <namespaceCode> | |
| OE | <namespaceCode> | |
| 01 | <bed> | |
| SUR | <hospitalService> | |
| I | <patientClass> | |
| 2000 | <pointOfCareCode> | |
| Q6H | <repeatPattern> | |
| C | <repeatPattern> | |
| 2012 | <room> | |
| PCIS1 | <namespaceCode> | |
| RX | <namespaceCode> | |
Codes available for particular patients
A generic query. If you filter on simpleIdentifier, you can hone in on people about whom something particular is said. In itself, this is crude. It will pull in codes for ‘kilogram’ as well as for observations. However, taken as a whole, it is a good starting point when examining information known about an individual.
SELECT DISTINCT ?givenName ?familyName ?nameOfCodingSystem ?p ?simpleIdentifier WHERE { ?a ?p ?code . ?code a <http://www.hoot72.com/ontology/Code> . OPTIONAL {?code hoot72:nameOfCodingSystem ?nameOfCodingSystem } . ?code hoot72:simpleIdentifier ?simpleIdentifier . ?a hoot72:tcontext ?patient . ?patient hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName}
| givenName | familyName | nameOfCodingSystem | p | simpleIdentifier |
|---|---|---|---|---|
| 27 entries | ||||
| JOHN | ROBERTSON | <requestedDosageForm> | IV | |
| JOHN | ROBERTSON | AHCPR | <pathwayCode> | OH457 |
| JOHN | ROBERTSON | Nursing Problem List | <problemCode> | 04411 |
| JOHN | ROBERTSON | Management Discipline List | <problemManagementDiscipline> | NU |
| JOHN | ROBERTSON | Role Master List | <role> | 12 |
| JOHN | ROBERTSON | <hospitalService> | SUR | |
| JOHN | ROBERTSON | Goal Master List | <goalCode> | 00312 |
| JOHN | ROBERTSON | Life Cycle Status List | <problemLifeCycleStatus> | A1 |
| JOHN | ROBERTSON | <allowSubstitutions> | N | |
| JOHN | ROBERTSON | Variance Class List | <varianceClassification> | 23 |
| JOHN | ROBERTSON | <providersPharmacyInstructions> | D5W WITH 1/2 NS WITH 20 MEQ KCL EVERY THIRD BOTTLE STARTING WITH FIRST | |
| JOHN | ROBERTSON | <requestedGiveUnits> | L | |
| JOHN | ROBERTSON | Next Review List | <currentGoalReviewStatus> | Due |
| JOHN | ROBERTSON | Ranking List | <problemRanking> | 2 |
| JOHN | ROBERTSON | Role Master List | <role> | 45 |
| JOHN | ROBERTSON | Persistence List | <problemPersistence> | Acute |
| JOHN | ROBERTSON | <admitSource> | ADM | |
| JOHN | ROBERTSON | Awareness Coding List | <individualAwarenessOfProblem> | 1 |
| JOHN | ROBERTSON | NDC | <administeredCode> | 0047-0402-30 |
| JOHN | ROBERTSON | <patientClass> | I | |
| JOHN | ROBERTSON | Certainty Coding List | <certaintyOfProblem> | HI |
| JOHN | ROBERTSON | Pathway Life Cycle Status List | <pathwayLifecycleStatus> | A1 |
| JOHN | ROBERTSON | <administeredUnits> | TAB | |
| JOHN | ROBERTSON | Prognosis Coding List | <problemPrognosis> | 2 |
| JOHN | ROBERTSON | Problem Classification List | <problemClassification> | IP |
| JOHN | ROBERTSON | Role Master List | <role> | 1 |
| JOHN | ROBERTSON | Confirmation Status List | <problemConfirmationStatus> | C |
Identifier
All identifiers
Nodes with identifiers anchor the graph. They include Patient and PatientVisit. The predicate(s) referencing a node help identify its type.
SELECT DISTINCT ?simpleIdentifier ?pred WHERE { ?a ?pred ?b . FILTER (?pred != <http://www.hoot72.com/ontology/tcontext>) . ?b ?pred1 ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier> . OPTIONAL {?identifier hoot72:simpleIdentifier ?simpleIdentifier }} ORDER BY ?pred
| simpleIdentifier | pred |
|---|---|
| 8 entries | |
| 004777 | <attendingDoctor> |
| 2045 | <context> |
| 0018329078785 | <context> |
| 1000 | <context> |
| 9999999 | <context> |
| 001 | <context> |
| 0123456-1 | <context> |
| 333 | <context> |
PersonName
All people
Get all people means get all PersonNames. Most referring predicates make sense. ‘personName’ is common. But some HL7 implementations overload segments and their fields making the equivalent predicates meaningless.
SELECT DISTINCT ?givenName ?familyName ?pred WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . OPTIONAL {?personName hoot72:familyName ?familyName} . OPTIONAL {?personName hoot72:givenName ?givenName }} ORDER BY ?pred
| givenName | familyName | pred |
|---|---|---|
| 5 entries | ||
| Jane | Wilson | <personName> |
| SIDNEY | LEBAUER | <personName> |
| Ellen | Smith | <personName> |
| JOHN | ROBERTSON | <personName> |
| John | Edwards | <personName> |
People without Identifiers
Some people lack identifiers. This makes unique identification difficult.
SELECT DISTINCT ?givenName ?familyName WHERE { ?a ?pred ?personName . ?personName a <http://www.hoot72.com/ontology/PersonName> . ?personName hoot72:familyName ?familyName . OPTIONAL {?personName hoot72:givenName ?givenName } . OPTIONAL {?a ?b ?identifier . ?identifier a <http://www.hoot72.com/ontology/Identifier>} . FILTER (!bound(?b))} ORDER BY ?familyName
| givenName | familyName |
|---|---|
| 3 entries | |
| Jane | Wilson |
| Ellen | Smith |
| John | Edwards |
All people who act as doctors
Like the previous query except we only select people which are referred to by a predicate containing ‘doctor’
SELECT DISTINCT ?givenName ?familyName ?role WHERE { ?a ?role ?person . ?person hoot72:personName ?personName . ?personName hoot72:givenName ?givenName ; hoot72:familyName ?familyName . FILTER regex(str(?role), "doctor", "i")}
| Property | Value(s) |
|---|---|
| givenName | SIDNEY |
| familyName | LEBAUER |
| role | <attendingDoctor> |
Time
All timestamps
What nodes are timed? These represent events of some sort. Something happened at a particular time or over a range of time.
SELECT DISTINCT ?timeValue ?pred WHERE { ?a ?pred ?time . ?time a <http://www.hoot72.com/ontology/Time> . ?time hoot72:timeValue ?timeValue} ORDER BY ?pred
| timeValue | pred |
|---|---|
| 15 entries | |
| 199505011200 | <actionDateTime> |
| 199505011200 | <changePathwayLifecycleStatusDateTime> |
| 199505021200 | <currentGoalReviewDateTime> |
| 199505011200 | <dateTimeStartOfAdministration> |
| 199505011200 | <documentedDateTime> |
| 199505011200 | <endDateTime> |
| 199505101200 | <expectedGoalAchievementDateTime> |
| 199505011200 | <goalEstablishedDateTime> |
| 199505011200 | <pathwayEstablishedDateTime> |
| 199504250000 | <problemDateOfOnset> |
| 199505011200 | <problemEstablishedDateTime> |
| 199505011200 | <problemLifeCycleStatusDateTime> |
| 199505011200 | <roleBeginDateTime> |
| 199505011201 | <roleBeginDateTime> |
| 199505011200 | <startDateTime> |
Observations
The OBX or Observation segment is shamelessly overloaded in HL7 messaging. A nurse administering a vaccine or a contact person is an observation! Most of these uses can be easily separated with careful querying.