Commit 52f075dd authored by R.W.Majeed's avatar R.W.Majeed
Browse files

Allow missing value attributes for eav groups

parent 466a8450
......@@ -66,6 +66,10 @@
<value modifier="T:mod:2" type="xsi:string">def456</value>
<value modifier="T:mod:3" type="xsi:decimal" unit="mm" flag="A">78.9</value>
</eav-group>
<!-- group without value -->
<eav-group concept="T:group:2">
<value modifier="T:mod:1"/>
</eav-group>
</facts>
</visit>
......
......@@ -43,4 +43,8 @@ XX12345 XXE12345 T:mod:1 @
XX12345 XXE12345 T:mod:2 str def456
XX12345 XXE12345 T:mod:3 dec 78.9 mm A
#@group(end)
#@group(start)
XX12345 XXE12345 T:group:2 @
XX12345 XXE12345 T:mod:1 @
#@group(end)
......@@ -227,7 +227,7 @@ class XMLObservationParser extends AbstractObservationParser{
AbstractValue val;
switch( factType ){
case None:
if( valueText.length() != 0 )
if( valueText != null && valueText.length() != 0 )
log.warning("Value type None, but content not empty");
val = AbstractValue.NONE;
break;
......
......@@ -141,6 +141,14 @@ public class FileObservationProviderTest {
Assert.assertEquals(new BigDecimal("78.9"), m.getValue().getNumericValue());
},
(Observation o) -> {
Assert.assertEquals("T:group:2", o.getConceptId());
Assert.assertEquals(Value.Type.None, o.getValue().getType());
Modifier m = o.getModifier("T:mod:1");
Assert.assertNotNull(m);
Assert.assertEquals("T:mod:1", m.getConceptId());
Assert.assertEquals(Value.Type.None, m.getValue().getType());
},
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment