AdlParser

public class AdlParser

This class provides methods for exploring, retrieving and updating the contents of a JSON structure representing an OpenEHR Archetype

Constructors

AdlParser

public AdlParser(JSONObject jsonData)

Instantiates a new adl parser.

Parameters:
  • jsonData – the json data

Methods

getItemsContainer

public AdlStructure getItemsContainer(String path)

Get an ADL structure containing all the items included in an archetype path. The path must be the absolute path of any of its items. For instance, providing the path data[at0001]/events[at0006]/data[at0003]/items[at0004] , this method returns the ADL structure included in data[at0001]/events[at0006]/data[at0003]

Parameters:
  • path – the path of an item
Returns:

the AdlStructure

getStructureByPath

public AdlStructure getStructureByPath(String path)

Get the structure corresponding to the specified path.

Parameters:
  • path – the path of an item
Returns:

the AdlStructure

replaceContent

public void replaceContent(String path, int index, JSONObject newContent)

Replace the content of a json structure.

Parameters:
  • path – the path of the json substructure to be replaced
  • index – the index of the json instance
  • newContent – the json structure containing the new json content
Throws:
  • JSONException – the JSON exception