set id when parsing StructureMap

This commit is contained in:
Grahame Grieve 2020-03-02 09:04:16 +11:00
parent f5e2d3405d
commit 137506f37f
3 changed files with 9 additions and 1 deletions

View File

@ -326,6 +326,7 @@ public class StructureMapUtilities {
lexer.token("map");
StructureMap result = new StructureMap();
result.setUrl(lexer.readConstant("url"));
result.setId(tail(result.getUrl()));
lexer.token("=");
result.setName(lexer.readConstant("name"));
lexer.skipComments();
@ -344,10 +345,15 @@ public class StructureMapUtilities {
parseGroup(result, lexer);
}
return result;
}
private void parseConceptMap(StructureMap result, FHIRLexer lexer) throws FHIRLexerException {
private String tail(String url) {
return url.substring(url.lastIndexOf("/")+1);
}
private void parseConceptMap(StructureMap result, FHIRLexer lexer) throws FHIRLexerException {
lexer.token("conceptmap");
ConceptMap map = new ConceptMap();
String id = lexer.readConstant("map id");

View File

@ -655,6 +655,7 @@ public class StructureMapUtilities {
lexer.token("map");
StructureMap result = new StructureMap();
result.setUrl(lexer.readConstant("url"));
result.setId(tail(result.getUrl()));
lexer.token("=");
result.setName(lexer.readConstant("name"));
lexer.skipComments();

View File

@ -712,6 +712,7 @@ public class StructureMapUtilities {
lexer.token("map");
StructureMap result = new StructureMap();
result.setUrl(lexer.readConstant("url"));
result.setId(tail(result.getUrl()));
lexer.token("=");
result.setName(lexer.readConstant("name"));
lexer.skipComments();