Feature
  Provide Composition API access over REST
  
  
        As a clinical informatics actor
In order to create, access and modify data based on openEHR compositions
I want to use a REST API to perform operations on compositions.
        
                      
  
  
  
  
  2s 058ms
    
    
  Background
  
  
       
  
  
  The server is ready, an EHR and a template is in place and the user is logged in.
  
    
    
    
  
          
        
  Given
  The server is running
  
  1s 892ms
  
        
        
        
        
        
  
       
          
        
  And
  The client system is logged into a server session
  
  046ms
  
        
        
        
        
        
  
       
          
        
  And
  The openEHR template IDCR - Immunisation summary.v0.opt for the composition is available to the server
  
  068ms
  
        
        
        
        
        
  
       
          
        
  And
  An EHR is created
  
  051ms
  
        
        
        
        
        
  
       
       
 
    
   
 
                      
  
  
  
  
  1s 903ms
    
    
  Scenario
  Commit composition in flat json format
  
       
  
  
  
  
    
    
    
  
          
        
  When
  Flat json file IDCR - Immunisation summary.v0.flat.json with template id IDCR - Immunisation summary.v0 is committed to service
  
  1s 902ms
  
        
        
        
        
        
  
       
          
        
  Then
  A composition id should be returned by the API
  
  000ms
  
        
        
        
        
        
  
       
       
 
    
  
        
    
              
          
            After
                          QueryWithAqlSteps.cleanUp()
                        
  007ms
          
                      
          
          
  
         
              
          
            After
                          CompositionAPISteps.cleanUp()
                        
  000ms
          
                      
          
          
  
         
           
   
   
 
                      
  
  
  
  
  1s 668ms
    
    
  Background
  
  
       
  
  
  The server is ready, an EHR and a template is in place and the user is logged in.
  
    
    
    
  
          
        
  Given
  The server is running
  
  1s 510ms
  
        
        
        
        
        
  
       
          
        
  And
  The client system is logged into a server session
  
  040ms
  
        
        
        
        
        
  
       
          
        
  And
  The openEHR template IDCR - Immunisation summary.v0.opt for the composition is available to the server
  
  071ms
  
        
        
        
        
        
  
       
          
        
  And
  An EHR is created
  
  046ms
  
        
        
        
        
        
  
       
       
 
    
   
 
                      
  
  
  
  
  798ms
    
    
  Scenario
  Commit composition in flat json and retrieve raw format
  
       
  
  
  
  
    
    
    
  
          
        
  When
  Flat json file IDCR - Immunisation summary.v0.flat.json with template id IDCR - Immunisation summary.v0 is committed to service
  
  680ms
  
        
        
        
        
        
  
       
          
        
  Then
  A composition id should be returned by the API
  
  000ms
  
        
        
        
        
        
  
       
          
        
  And
  Composition id should allow retrieval of composition in raw format
  
  118ms
  
        
  
    
      
      
        java.lang.AssertionError: 1 expectation failed.
Expected status code <200> doesn't match actual status code <500>.
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
	at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:598)
	at com.jayway.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
	at com.jayway.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:760)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
	at com.jayway.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:120)
	at com.jayway.restassured.specification.ResponseSpecification$statusCode$0.callCurrent(Unknown Source)
	at com.jayway.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:128)
	at com.jayway.restassured.internal.ValidatableResponseOptionsImpl.statusCode(ValidatableResponseOptionsImpl.java:117)
	at com.ethercis.vehr.CompositionAPISteps.getComposition(CompositionAPISteps.java:85)
	at com.ethercis.vehr.CompositionAPISteps.compositionIdShouldAllowRetrievalOfCompositionInRawFormat(CompositionAPISteps.java:72)
	at ✽.And Composition id should allow retrieval of composition in raw format(RestApiComposition.feature:21)
       
     
   
        
        
        
        
  
       
       
 
    
  
        
    
              
          
            After
                          QueryWithAqlSteps.cleanUp()
                        
  007ms
          
                      
          
          
  
         
              
          
            After
                          CompositionAPISteps.cleanUp()
                        
  000ms
          
                      
          
          
  
         
           
   
   
 
                      
  
  
  
  
  2s 122ms
    
    
  Background
  
  
       
  
  
  The server is ready, an EHR and a template is in place and the user is logged in.
  
    
    
    
  
          
        
  Given
  The server is running
  
  2s 012ms
  
        
        
        
        
        
  
       
          
        
  And
  The client system is logged into a server session
  
  031ms
  
        
        
        
        
        
  
       
          
        
  And
  The openEHR template IDCR - Immunisation summary.v0.opt for the composition is available to the server
  
  038ms
  
        
        
        
        
        
  
       
          
        
  And
  An EHR is created
  
  040ms
  
        
        
        
        
        
  
       
       
 
    
   
 
                      
  
  
  
  
  743ms
    
    
  Scenario
  Commit composition in flat json and retrieve xml format
  
       
  
  
  
  
    
    
    
  
          
        
  When
  Flat json file IDCR - Immunisation summary.v0.flat.json with template id IDCR - Immunisation summary.v0 is committed to service
  
  491ms
  
        
        
        
        
        
  
       
          
        
  Then
  A composition id should be returned by the API
  
  000ms
  
        
        
        
        
        
  
       
          
        
  And
  Composition id should allow retrieval of composition in xml format
  
  251ms
  
        
        
        
        
        
  
       
       
 
    
  
        
    
              
          
            After
                          QueryWithAqlSteps.cleanUp()
                        
  010ms
          
                      
          
          
  
         
              
          
            After
                          CompositionAPISteps.cleanUp()
                        
  000ms