Package org.fhirfrog.frog.shorthand
Class TSHProcessor
java.lang.Object
org.fhirfrog.frog.shorthand.TSHProcessor
Main entry point for parsing TSH files and compiling to FHIR TestScript resources.
Example usage:
TSHProcessor processor = new TSHProcessor();
// Parse from file
TestScript testScript = processor.parse(Path.of("test.tsh"));
// Parse from string
String tsh = "TestScript: MyTest\nTitle: \"My Test\"\n...";
TestScript testScript = processor.parse(tsh);
// Serialize to JSON
String json = processor.toJson(testScript);
// Serialize to XML
String xml = processor.toXml(testScript);
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.hl7.fhir.r4.model.TestScriptParse TSH string and compile to TestScript.org.hl7.fhir.r4.model.TestScriptParse TSH file and compile to TestScript.toJson(org.hl7.fhir.r4.model.TestScript testScript) Serialize TestScript to JSON.toXml(org.hl7.fhir.r4.model.TestScript testScript) Serialize TestScript to XML.
-
Constructor Details
-
TSHProcessor
public TSHProcessor()
-
-
Method Details
-
parse
Parse TSH file and compile to TestScript.- Parameters:
tshFile- path to .tsh file- Returns:
- compiled TestScript resource
- Throws:
IOException- if file cannot be read
-
parse
Parse TSH string and compile to TestScript.- Parameters:
tshContent- TSH source code- Returns:
- compiled TestScript resource
-
toJson
Serialize TestScript to JSON.- Parameters:
testScript- TestScript resource to serialize- Returns:
- pretty-printed JSON string
-
toXml
Serialize TestScript to XML.- Parameters:
testScript- TestScript resource to serialize- Returns:
- pretty-printed XML string
-