Package uk.nhs.interoperability.payloads.noncodedcdav2

Examples of uk.nhs.interoperability.payloads.noncodedcdav2.NonCodedCDAPerformanceTest


 
  @Test
  public void testCreateDocumentMissingMandatoryFields() {
    NonCodedCDACommonFields fields = new NonCodedCDACommonFields();
    try {
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(fields);
      fail("Expected exception was not thrown to list missing mandatory fields");
    } catch (MissingMandatoryFieldException e) {
      System.out.println(e.toString());
      // We expect 18 missing mandatory fields to be reported
      assertEquals(18, e.getMissingFields().size());
View Full Code Here


  @Test
  public void testCreateDocumentMinimalNonXMLBody() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-serialiseMinimalNonXMLBody", "NonCodedCDA Helper: Minimal Non-XML Body Serialise", "This uses the helper class to generate a full non-coded CDA document with a minimal set of fields, and serialises to a CDA document, which is compared with an expected document example.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(minimal);
      String data = "PFRlc3RYTUw+PC9UZXN0WE1MPg==";
      doc = NonCodedCDADocumentCreationHelper.addNonXMLBody(doc, AttachmentType.Base64, "text/xml", data);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
      FileWriter.writeFile("output.xml", xml.getBytes());
     
      // Generate the rendered version
      super.render(xml);
     
View Full Code Here

  @Test
  public void testCreateDocumentFullNonXMLBody() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-serialiseFullNonXMLBody", "NonCodedCDA Helper: Full Non-XML Body Serialise", "This uses the helper class to generate a full non coded CDA document with a full set of fields, and serialises to a CDA document, which is compared with an expected document example.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(full);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
     
      // Generate the rendered version
      super.render(xml);
     
      content = content.replaceAll("#TESTRESULT#", "<div class='pass'>PASS: Successfully created full CDA document</div>");
View Full Code Here

  @Test
  public void testMinimalNonXMLBodyDocumentSchemaCheck() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-MinimalNonXMLBodySchemaCheck", "NonCodedCDA Helper: Minimal Non-XML Body Schema Check", "This uses the helper class to generate a full non coded CDA document with a minimal set of fields, and serialises to a CDA document, which is validated against the on-the-wire schema.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(minimal);
      String data = "PFRlc3RYTUw+PC9UZXN0WE1MPg==";
      doc = NonCodedCDADocumentCreationHelper.addNonXMLBody(doc, AttachmentType.Base64, "text/xml", data);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
      // Now check it is valid according to the schema
      testAgainstSchema(
          PropertyReader.getProperty("nonCodedCDASchemaPath")+"POCD_MT000002UK01.xsd",
          xml);
     
View Full Code Here

  @Test
  public void testMinimalNonXMLBodyDocumentTemplatedSchemaCheck() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-MinimalNonXMLBodyTemplatedCheck", "NonCodedCDA Helper: Minimal Non-XML Body Templated Check", "This uses the helper class to generate a full non coded CDA document with a minimal set of fields, and serialises to a CDA document, transforms it to templated format, which is validated against the templated schema.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(minimal);
      String data = "PFRlc3RYTUw+PC9UZXN0WE1MPg==";
      doc = NonCodedCDADocumentCreationHelper.addNonXMLBody(doc, AttachmentType.Base64, "text/xml", data);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
      // And then transform and re-test against templated schema
      testAgainstTemplatedSchema(
          PropertyReader.getProperty("nonCodedCDASchemaPath")+"POCD_MT010011GB02.xsd",
          xml);
     
View Full Code Here

  @Test
  public void testFullNonXMLBodyDocumentSchemaCheck() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-FullNonXMLBodySchemaCheck", "NonCodedCDA Helper: Full Non-XML Body Schema Check", "This uses the helper class to generate a full non coded CDA document with a minimal set of fields, and serialises to a CDA document, which is validated against the on-the-wire schema.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(full);
      String data = "PFRlc3RYTUw+PC9UZXN0WE1MPg==";
      doc = NonCodedCDADocumentCreationHelper.addNonXMLBody(doc, AttachmentType.Base64, "text/xml", data);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
      // Now check it is valid according to the schema
      testAgainstSchema(
          PropertyReader.getProperty("nonCodedCDASchemaPath")+"POCD_MT000002UK01.xsd",
          xml);
     
View Full Code Here

  @Test
  public void testFullNonXMLBodyDocumentTemplatedSchemaCheck() {
    super.init("noncodedcda/", "NonCodedCDAv2Helper-FullNonXMLBodyTemplatedCheck", "NonCodedCDA Helper: Full Non-XML Body Templated Check", "This uses the helper class to generate a full non coded CDA document with a minimal set of fields, and serialises to a CDA document, transforms it to templated format, which is validated against the templated schema.");
    try {
      // Use the helper to create the document
      ClinicalDocument doc = NonCodedCDADocumentCreationHelper.createDocument(full);
      String data = "PFRlc3RYTUw+PC9UZXN0WE1MPg==";
      doc = NonCodedCDADocumentCreationHelper.addNonXMLBody(doc, AttachmentType.Base64, "text/xml", data);
      // Serialise to a CDA XML Document
      String xml = doc.serialise();
      // And then transform and re-test against templated schema
      testAgainstTemplatedSchema(
          PropertyReader.getProperty("nonCodedCDASchemaPath")+"POCD_MT010011GB02.xsd",
          xml);
     
View Full Code Here

TOP

Related Classes of uk.nhs.interoperability.payloads.noncodedcdav2.NonCodedCDAPerformanceTest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.