ошибка при загрузке таблицы XML в Oracle: ошибка XPATH - PullRequest
0 голосов
/ 06 января 2020

Мне нужно вытащить данные из нижнего тега.

** <code code="10" displayName="comment" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.19"/>

<value xsi:type="ED">Despite temporal causality suggesting plausibility, an alternative aetiology is that the patient was massively overweight</value> **

нижеприведенный скрипт был использован для извлечения, однако я получаю сообщение об ошибке, как показано ниже:

SELECT
seq_xml_Master_id.nextval,
b1.C_1_1,
TO_TIMESTAMP(b1.C_1_2, 'YYYYMMDD HH24MISS.FF') "C_1_2",
B1.H_1,
--B1.H_2
(select H_2 
  from
   gom_e2br3_imp_queue imp,
        XMLTABLE ( xmlnamespaces('urn:hl7-org:v3' as "xa"), '/xa:observationevent/[xa:code/@code="10"]' passing b1.H_2_XML
        columns
        H_2 Varchar2(4000) path 'xa:observationEvent/xa:value/@value') 

        )
        "H_2"
FROM
GOM_e2br3_imp_queue imp,
        XMLTABLE (  xmlnamespaces('urn:hl7-org:v3' as "xa"),  '/xa:MCCI_IN200100UV01' PASSING imp.xml_data 
        COLUMNS 
         c_1_1 VARCHAR2(100) PATH 'xa:PORR_IN049016UV/xa:controlActProcess/xa:subject/xa:investigationEvent/xa:id[1]/@extension',   
         c_1_2 VARCHAR2(21) PATH 'xa:PORR_IN049016UV/xa:controlActProcess/xa:effectiveTime/@value',
         H_1 VARCHAR2(4000) PATH 'xa:PORR_IN049016UV/xa:controlActProcess/xa:subject/xa:investigationEvent/xa:text',
         H_2_XML  XMLTYPE  PATH 'xa:PORR_IN049016UV/xa:controlActProcess/xa:subject/xa:investigationEvent/xa:component/xa:adverseEventAssessment/xa:component1/xa:observationevent'

          ) b1;

ORA -31013: Неверное выражение XPATH 31013. 00000 - «Неверное выражение XPATH»

<?xml version="1.0" encoding="UTF-8"?>

<MCCI_IN200100UV01 ITSVersion="XML_1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 http://eudravigilance.ema.europa.eu/XSD/multicacheschemas/MCCI_IN200100UV01.xsd">

<id extension="ichicsr-Clincal trial2" root="2.16.840.1.113883.3.989.2.1.3.22"/>

<creationTime value="20170921113830"/>

<responseModeCode code="D"/>

<interactionId extension="MCCI_IN200100UV01" root="2.16.840.1.113883.1.6"/>

<name code="1" displayName="ICHICSR" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.1"/>


<PORR_IN049016UV>

<id extension="SE-EMA-R3-TESTCASE01" root="2.16.840.1.113883.3.989.2.1.3.1"/>

<creationTime value="20170921113830"/>

<interactionId extension="PORR_IN049016UV" root="2.16.840.1.113883.1.6"/>

<processingCode code="P"/>

<processingModeCode code="T"/>

<acceptAckCode code="AL"/>

<controlActProcess classCode="CACT" moodCode="EVN">

<code code="PORR_TE049016UV" codeSystem="2.16.840.1.113883.1.18"/>

<effectiveTime value="20170921113830"/>


<subject typeCode="SUBJ">

<investigationEvent classCode="INVSTG" moodCode="EVN">

<id extension="SE-EMA-R3-TESTCASE01" root="2.16.840.1.113883.3.989.2.1.3.1"/>

<id extension="SE-EMA-R3-TESTCASE01" root="2.16.840.1.113883.3.989.2.1.3.2"/>

<code code="PAT_ADV_EVNT" codeSystem="2.16.840.1.113883.5.4"/>

<text>An obese 69 year-old man took 10ml of strawberry-flavoured Calpol for headache & toothache at 10am & 2pm. At 8pm he experienced a massive cardiac arrest and died at 10pm</text>

<statusCode code="active"/>

<availabilityTime value="20170524"/>

<component typeCode="COMP">

<adverseEventAssessment classCode="INVSTG" moodCode="EVN">

<component1 typeCode="COMP">


<observationEvent classCode="OBS" moodCode="EVN">

<code code="10" displayName="comment" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.19"/>

<value xsi:type="ED">Despite temporal causality suggesting plausibility, an alternative aetiology is that the patient was massively overweight</value>


<author typeCode="AUT">


<assignedEntity classCode="ASSIGNED">

<code code="3" displayName="sourceReporter" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.21"/>

</assignedEntity>

</author>

</observationEvent>

</component1>


<component1 typeCode="COMP">


<observationEvent classCode="OBS" moodCode="EVN">

<code code="10" displayName="comment" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.19"/>

<value xsi:type="ED">Although the MAH thought it was not related, we, the NCA that is the sender of this case, think it was</value>


<author typeCode="AUT">


<assignedEntity classCode="ASSIGNED">

<code code="1" displayName="sender" codeSystemVersion="2.0" codeSystem="2.16.840.1.113883.3.989.2.1.1.21"/>

</assignedEntity>

</author>

</observationEvent>

</component1>

</adverseEventAssessment>

</component>

</investigationEvent>

</subject>

</controlActProcess>

</PORR_IN049016UV>

<receiver typeCode="RCV">

<device determinerCode="INSTANCE" classCode="DEV">

<id extension="EVCTMTEST" root="2.16.840.1.113883.3.989.2.1.3.14"/>

</device>

</receiver>


<sender typeCode="SND">


<device determinerCode="INSTANCE" classCode="DEV">

<id extension="MAHTEST1" root="2.16.840.1.113883.3.989.2.1.3.13"/>

</device>

</sender>

</MCCI_IN200100UV01>
...