Add pattern support to 2016may

This commit is contained in:
Lloyd McKenzie 2019-09-06 21:26:26 -06:00
parent bd38230662
commit 2b0dbf7224
2 changed files with 4 additions and 0 deletions

View File

@ -3640,6 +3640,8 @@ public class ProfileUtilities extends TranslatingUtilities {
public static ElementDefinitionSlicingDiscriminatorComponent interpretR2Discriminator(String discriminator) { public static ElementDefinitionSlicingDiscriminatorComponent interpretR2Discriminator(String discriminator) {
if (discriminator.endsWith("@pattern"))
return makeDiscriminator(DiscriminatorType.PATTERN, discriminator.length() == 8 ? "" : discriminator.substring(0,discriminator.length()-9));
if (discriminator.endsWith("@profile")) if (discriminator.endsWith("@profile"))
return makeDiscriminator(DiscriminatorType.PROFILE, discriminator.length() == 8 ? "" : discriminator.substring(discriminator.length()-9)); return makeDiscriminator(DiscriminatorType.PROFILE, discriminator.length() == 8 ? "" : discriminator.substring(discriminator.length()-9));
if (discriminator.endsWith("@type")) if (discriminator.endsWith("@type"))
@ -3656,6 +3658,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public static String buildR2Discriminator(ElementDefinitionSlicingDiscriminatorComponent t) throws FHIRException { public static String buildR2Discriminator(ElementDefinitionSlicingDiscriminatorComponent t) throws FHIRException {
switch (t.getType()) { switch (t.getType()) {
case PROFILE: return t.getPath()+"/@profile"; case PROFILE: return t.getPath()+"/@profile";
case PATTERN: return t.getPath()+"/@pattern";
case TYPE: return t.getPath()+"/@type"; case TYPE: return t.getPath()+"/@type";
case VALUE: return t.getPath(); case VALUE: return t.getPath();
case EXISTS: return t.getPath(); // determination of value vs. exists is based on whether there's only 2 slices - one with minOccurs=1 and other with maxOccur=0 case EXISTS: return t.getPath(); // determination of value vs. exists is based on whether there's only 2 slices - one with minOccurs=1 and other with maxOccur=0

View File

@ -4675,6 +4675,7 @@ public class ProfileUtilities extends TranslatingUtilities {
public static String buildR2Discriminator(ElementDefinitionSlicingDiscriminatorComponent t) throws FHIRException { public static String buildR2Discriminator(ElementDefinitionSlicingDiscriminatorComponent t) throws FHIRException {
switch (t.getType()) { switch (t.getType()) {
case PROFILE: return t.getPath()+"/@profile"; case PROFILE: return t.getPath()+"/@profile";
case PATTERN: return t.getPath()+"/@pattern";
case TYPE: return t.getPath()+"/@type"; case TYPE: return t.getPath()+"/@type";
case VALUE: return t.getPath(); case VALUE: return t.getPath();
case EXISTS: return t.getPath(); // determination of value vs. exists is based on whether there's only 2 slices - one with minOccurs=1 and other with maxOccur=0 case EXISTS: return t.getPath(); // determination of value vs. exists is based on whether there's only 2 slices - one with minOccurs=1 and other with maxOccur=0